//Circuito 3
const int boton = 32; // Pin donde está el botón.
const int led1 = 17; // Led del botón.
void setup() {
pinMode(boton, INPUT_PULLDOWN); // Configura el botón como entrada.
pinMode(led1, OUTPUT); // Led del botón.
}
void loop() {
// Tercera parte, incorporación del boton y led.
// Lee el estado del botón
int buttonState = digitalRead(boton);
// Si el botón está presionado (LOW)
if (buttonState == HIGH) { // Si el botón está presionado
digitalWrite(led1, HIGH); // Enciende el LED
} else {
digitalWrite(led1, LOW); // Apaga el LED
}
}