Hey guys i have followed along with spaceship interface and come up with a complation error else without a previous if.
i have both if and else but have something not right
any help would be greatly appreciated
my code is below
int switchState = 0;
void setup() {
pinMode (3, OUTPUT);
pinMode (4, OUTPUT);
pinMode (5, OUTPUT);
pinMode (2, INPUT);
}
void loop() {
switchState = digitalRead (2);
// reading for power on pin 2 connected to button
if( switchState == LOW); {
// the button is not pressed
digitalWrite (3, HIGH);
digitalWrite (4, LOW);
digitalWrite (5, LOW);
}
else { //the button is pressed
digitalWrite (3, LOW);
digitalWrite (4, LOW);
digitalWrite (5, HIGH);
delay (250); //wait quater second
//toggle leds
digitalWrite (4, HIGH);
digitalWrite (5, LOW);
delay(250); // wait quarter second
}
}//go back to begining of loop