I was writeing this simple arduino code and I got this error. I can clearly see that there are the appropriate brackets in place.
void setup() {
// put your setup code here, to run once:
pinMode(A7, OUTPUT);//sfx
pinMode(A5, INPUT)pinMode(A6, OUTPUT);//flash
; //Button
}
void loop() {
// put your main code here, to run repeatedly
if (digitalRead(A5) == HIGH) {
digitalWrite(A6 ,HIGH); //flash
delay(250);
digitalWrite(A6, LOW);
delay(100);
digitalWrite(A7, HIGH);
delay(1000);
digitalWrite(A7, LOW);
delay(25000);
} else if (digitalRead(A5) == LOW);
{
digitalWrite(A6 ,HIGH); //flash
delay(250);
digitalWrite(A6, LOW);
delay(100);
digitalWrite(A7, HIGH);
delay(1000);
digitalWrite(A7, LOW);
}
I didn't know what to do to fi this issue.
Despite your assurance that you have the requisite brackets, you don't.
Your
loopfunction needs a closing}.Employing consistent indentation is not just about making code pretty. It makes it easier to understand and debug. Keep in mind also that it's always your fault.
As noted in comments, also beware the
;afterelse if (digitalRead(A5) == LOW). This won't cause a compiler error, but it radically changes the behavior of your code vs. what's intended.