sketch_sep26b.ino:76:4: error: expected unqualified-id before 'if'


i have problem modified ide pygmalion
in sketch i'm writing, when i'm compilig, throws me this

quote
sketch_sep26b.ino:76:4: error: expected unqualified-id before 'if'
this sketch

quote
int intersecciones = 0;
int botellas = 0;

void setup() {
  motorspeed(m1,100);
  motorspeed(m2,100);
 
}
 
void loop() {

  if(lineread(j1) == void && lineread(j2) == void){
      motorsoff(m1,m2);   
    }
   
    if(lineread(j1) == black && lineread(j2) == black){
      goforward(m1,m2);
    }
   
    if(lineread(j1) == black && lineread(j2) == white){
      turnright(m1,m2);
    }
   
    if(lineread(j1) == white && lineread(j2) == black){
      turnleft(m1,m2);
    }
   
    if(lineread(j1) == white && lineread(j2) == white){
      intersecciones++;
     
     
     goforward(m1,m2);
     delay(200);
     motorsoff(m1,m2);
     delay(50);
     
        if(intersecciones == 1){
        turnright(m1,m2);
        delay(300);
        while(lineread(j1) == black){
         turnright(m1,m2);
        }
        }
           if(intersecciones == 4){
       goforward(m1,m2);
        delay(1000);
        motorsoff(m1,m2);
        motoron(m3,reverse);
        delay (300);
        goreverse(m1,m2);
        delay (800);
        while(lineread(j1) == white && lineread(j2) == white){
        goreverse(m1,m2);
        }
         turnright(m1,m2);
        delay(300);
         while(lineread(j1) == black){
        turnright(m1,m2);
         }
        botellas++;
        }
        }
   
    if(intersecciones == 2||intersecciones == 5){
        turnleft(m1,m2);
        delay(300);
        while(lineread(j1) == black){
        turnleft(m1,m2);
     }
    }
    if(intersecciones == 3){
        goforward(m1,m2);
        delay (10);
   }
  }
   if(ultrasoundread(j3) <=9){
     botellas++;
     
      if(botellas == 1){
        motoroff(m1,m2);
        motoron(m3,forward);
        delay (300);
        motoroff(m3);
      }
     
       if(botellas == 2){
        motoroff(m1,m2);
        motoron(m3,forward);
        delay (300);
        motoroff(m3);
        turnleft(m1,m2);
        delay (200);
        goforward(m1,m2);
        delay (1000);
        motoroff(m1,m2);
        motoron(m3,reverse);
        delay (300);
        goreverse(m1,m2);
        delay (1000);
        turnright(m1,m2);
        delay (200);
       
      }
     

       
       
     
      }
   
   }
     
}
   
any ideas?
sorry english.

yes.

make '{'s match '}'s.

there superfluous '}' in line 75 , couple more in end.


Arduino Forum > Using Arduino > Programming Questions > sketch_sep26b.ino:76:4: error: expected unqualified-id before 'if'


arduino

Comments