1

my Error is : "exit Status 1 expected ')' before ';' token

This is my Code :

void setup () { 

 for (int pin=2; pin <14; pin++) {
pinMode (pin ; OUTPUT)} ;
 }
}

void loop () {
  for (int i=2; i<14; i++) { 
    digitalWrite (i, HIGH) ;
    delay(20); 
    digitalWrite(i+1,HIGH) ;
    delay(20) ; 
    digitalWrite(i+2, HIGH) ; 
    delay(20) ; 
    digitalWrite(i, LOW) ; 
    delay(20) ; 
    digitalWrite(i+1, LOW) ;
  }
}

// 
for (int i=13; i>1; i--) { 
    digitalWrite (i, HIGH) ;
    delay(20); 
    digitalWrite(i-1,HIGH) ;
    delay(20) ; 
    digitalWrite(i-2, HIGH) ; 
    delay(20) ; 
    digitalWrite(i, LOW) ; 
    delay(20) ; 
    digitalWrite(i-1, LOW) ;
}
2
  • 2
    You have missmatched curly brackets. And the last for loop is outside of any function, which is not valid in C/C++. Though this is off topic here, sorry. – chrisl May 28 at 18:57
  • 3
    Because you separated the "pinMode" params woth a semicolon instead of a comma. You also have a bunch of code not in a method. – Dave Newton May 28 at 18:57

Browse other questions tagged or ask your own question.