Empezando con Arduino

Me compré un Kit de Arduino Uno y he estado intentando cargar un Sketch y siempre me sale un error

de compilación y no funciona es con tres LEDs 2 rojos y uno verde y un pulsador que venía con el libro

en inglés y nada de nada.

No sé mucho pero aqui lo pongo por si alguien me dice donde esta el error de compilación que pone:

primera_prueba.ino:5:1:error:expected unqualified-id before numeric constant

primera_prueba.ino:6:1:error:expected unqualified-id before numeric constant

primera_prueba.ino:4:1:error:expected unqualified-id before numeric constant

primera_prueba.ino:7:1:error:expected unqualified-id before numeric constant

primera_prueba.ino:14:1:error:expected unqualified-id before numeric constant

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 // this is a comment

11 if (switchState ==LOW){

12 // the button is not pressed

13 digitalWrite(3, HIGH); // green LED

14 digitalWrite(4, HIGH); // 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, HIGH);

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 of the loop

Did you really type the numbers and (inconsistent) symbols as part of the code? They are not supposed to be there.

I do not understand.You could give an example

ami me funciona, ;D

int switchState=0;


 void setup(){

 pinMode(3, OUTPUT);

 pinMode(4, OUTPUT);

 pinMode(5, OUTPUT);

 pinMode(2, INPUT);

 }
 void loop(){

 switchState = digitalRead(2);

 // this is a comment



 if (switchState ==LOW){

 // the button is not pressed


 digitalWrite(3, HIGH); // green LED

 digitalWrite(4, HIGH); // red LED

 digitalWrite(5, LOW); // red LED

 }


 else { // the button is pressed

 digitalWrite(3, LOW);

 digitalWrite(4, LOW);

 digitalWrite(5, HIGH);


 delay(250); // wait for a quarter second

 // toggle the LEDs

 digitalWrite(4, HIGH);

 digitalWrite(5, LOW);

 delay(250); // wait for a quarter second

}

 } // go back to the beginning of the loop

Make these changes

pinMode(2, INPUT);  >> INPUT_PULLUP, wire button to connect pin to GND when pressed

Combine & look for a LOW on the pin:

 switchState = digitalRead(2);
 // this is a comment
 if (switchState ==LOW){
 // the button is not pressed

Into this:

if (digitalRead(2) == HIGH){
// the button is not pressed

creo que ha copiado los numeros de indixacion, ese habra sido el error¡¡ ;) ;)