const int pinBoton = 8; // the number of the pushbutton pin const int pinLed = 3; // the number of the LED pin int estadoBoton = 0; // variable for reading the pushbutton status void setup() { pinMode(pinLed, OUTPUT); pinMode(pinBoton, INPUT); } void loop() { estadoBoton = digitalRead(pinBoton); if (estadoBoton == LOW) { digitalWrite(pinLed, LOW); } else { digitalWrite(pinLed, HIGH); } }