So i am doing this school project, where we are programming an arduino. Everything was going well untill i encountered a problem which i couldn't solve. Therefore i was hoping to find help in you!
My loop looks like this:
void loop() {
int buttonState = 0;
int buttonState2 = 0;
buttonState = digitalRead(button1);
buttonState2 = digitalRead (MASTERSWITCH);
if ((buttonState == HIGH) and (buttonState2 == HIGH));
{
digitalWrite(led1, HIGH);
}
else
{
digitalWrite(led1, LOW);
}
}
and i keep getting the error: exit status 1: 'else' without a previous 'if'
Which i honestly don't understand since i do have a previous 'if'.
I hope you can help me!
And i appreciate all kinds of help!