won't compile

static int lastState = 0;
   static int count = 0 ;   //number of pulses for each card
  static int countb = 0 ;
 
  
 int outputPin = 13;     //names pins
 int inputPin =10;
 int fullPin =8;
 int maxCount =100;     //number of pulse's before this card shuts off
int newcard = 0;
 void setup()
 {
   Serial.begin(9600);     //just for now so i can see what's going on 
   digitalWrite (fullPin, HIGH);
   pinMode(outputPin,OUTPUT);
   pinMode(inputPin, INPUT);     //make's pin 10 input pin 


  
}





void loop()
{
  while (Serial.available() == 0);     // this is going to be input from card
int val = Serial.read();     //will be input from card reader

   
if (val == '1')      //if this is the card number do the next stuff if not keep looking
{
  Serial.println("card 1 step 1 ");
int maxCount =1;      //number of pulse's befor end
int newState = digitalRead(inputPin);  //pulse from flow meter
  
   if (newState != lastState)     //detect change
       
   
   //Serial.println("card1 step 2");   //just for now so i can see what's going on
    //Serial.println(count);   //just for now so i can see what's going on
     count ++;    //adds one to count
     // Serial.println("card1 step 3");
     lastState = newState;
      //Serial.println("card1 step 4");
      Serial.println(count);
     if (count > maxCount)     //when count gets to the set number sends 5v to pin 13
     {// Serial.println("card1 step 5");
       digitalWrite(outputPin, HIGH);   // power to relay to shut flow 
     } 
   }
   {}
 
}

     // looks for next card numder

  if (val == '2')      //if this is the card number do the next stuff if not keep looking
{
  Serial.println("card 2");
int maxCountb =1000;      //number of pulse's befor end
int newState = digitalRead(inputPin);    //pulse from flow meter
   if (newState != lastState)     
       // Serial.println(count);
   {
     countb ++;    //adds one to count
     lastState = newState;
     if (count > maxCountb)     //when count gets to the set number sends 5v to pin 13
     {
       digitalWrite(outputPin, HIGH);      // power to relay to shut flow   
     
   }
   }
}

static int lastState = 0;
   static int count = 0 ;   //number of pulses for each card
  static int countb = 0 ;
 
  
 int outputPin = 13;     //names pins
 int inputPin =10;
 int fullPin =8;
 int maxCount =100;     //number of pulse's before this card shuts off
int newcard = 0;
 void setup()
 {
   Serial.begin(9600);     //just for now so i can see what's going on 
   digitalWrite (fullPin, HIGH);
   pinMode(outputPin,OUTPUT);
   pinMode(inputPin, INPUT);     //make's pin 10 input pin 


  
}





void loop()
{
  while (Serial.available() == 0);     // this is going to be input from card
int val = Serial.read();     //will be input from card reader

   
if (val == '1')      //if this is the card number do the next stuff if not keep looking
{
  Serial.println("card 1 step 1 ");
int maxCount =1;      //number of pulse's befor end
int newState = digitalRead(inputPin);  //pulse from flow meter
  
   if (newState != lastState)     //detect change
       
   
   //Serial.println("card1 step 2");   //just for now so i can see what's going on
    //Serial.println(count);   //just for now so i can see what's going on
     count ++;    //adds one to count
     // Serial.println("card1 step 3");
     lastState = newState;
      //Serial.println("card1 step 4");
      Serial.println(count);
     if (count > maxCount)     //when count gets to the set number sends 5v to pin 13
     {// Serial.println("card1 step 5");
       digitalWrite(outputPin, HIGH);   // power to relay to shut flow 
     } 
   }
   {}
 
}

     // looks for next card numder

  if (val == '2')      //if this is the card number do the next stuff if not keep looking
{
  Serial.println("card 2");
int maxCountb =1000;      //number of pulse's befor end
int newState = digitalRead(inputPin);    //pulse from flow meter
   if (newState != lastState)     
       // Serial.println(count);
   {
     countb ++;    //adds one to count
     lastState = newState;
     if (count > maxCountb)     //when count gets to the set number sends 5v to pin 13
     {
       digitalWrite(outputPin, HIGH);      // power to relay to shut flow   
     
   }
   }
}

why wont this compile

Moderator edit: Code box posting corrected. AWOL

If it failed to compile, then the compiler will have given you some errors as an indication of what failed. What were those errors?

And your code is not inside your code tags.

why wont this compile

I'm pretty sure the compiler told you exactly why it didn't. You need to share that, and learn to understand what it is telling you.

You also need to learn how to post code properly. Edit your post. Select all the code, and press the button with the # icon. Save.

maddave:
why wont this compile

:58: error: expected unqualified-id before 'if'

Looks like you have an extra '}' before the 'if' on line 58 which puts that 'if' outside the loop() function. If you take that '}' and move it to the end of teh file (AFTER the 'if' statement) your sketch compiles.

58: expected unqualifield-id before 'if'

thanks edison but wich one

thanks edison but wich one

First off his name is johnwasser. Edison is the class of member he is.

Second, the one on line 58, the clue is that the message says 58. It is probably highlighted in the arduino IDE window as well.

if (newState != lastState)     //detect change
      
  
   //Serial.println("card1 step 2");   //just for now so i can see what's going on
    //Serial.println(count);   //just for now so i can see what's going on
     count ++;    //adds one to count
     // Serial.println("card1 step 3");
     lastState = newState;

I don't think that's what you want. It will only increment "count" if the condition is met, it will always set "lastState".
Maybe this is what you want - braces {} would make things clearer.

You need to pay more attentions to indentation, it will help you spot this sort of thing - the auto-format (ctrl-T) tool is useful for this.

thanks everyone and sorry john

AWOL:
You need to pay more attentions to indentation, it will help you spot this sort of thing - the auto-format (ctrl-T) tool is useful for this.

I just want to doubly stress that. Properly indented code is clean (or, at least, cleaner) code. Clean code is easy to read code. Easy to read code is also easier to debug and/or maintain.