We've copied the program exactly from the book, we think, but we get the error message "expected unqualified-id before numeric constant". Where did we go wrong? Thanks in advance if you can help.
1 int switchState = 0;
2 void setup(){
3 pinMode(3,OUTPUT);
4 pinMode(4,OUTPUT);
5 pinMode(5,OUTPUT);
6 pinMode(2,INPUT);
7 }
8 void loop(){
9 switchState = digitalRead(2);
10 //
11 if (switchState == LOW) {
12// the button is not pressed
13 digitalWrite(3, LOW);//GREEN LED
14 digitalWrite(4, LOW);//RED LED
15 digitalWrite(5, LOW);//RED LED
16 }
17 else { //the button is pressed
18 digitalWrite(3,LOW);
19 digitalWrite(4,LOW);
20 digitalWrite(5,LOW);
21 delay(250); //wait for a quarter second
22// toggle the LEDS
23 digitalWrite(4, HIGH);
24 digitalWrite(5, LOW);
25 delay(250); //wait for a quarter second
26 }
27 } //go back to the beginning