const int boton1Pin = 2; // Pin para el primer botón
const int boton2Pin = 3; // Pin para el segundo botón
const int ledPin = 13; // Pin para el LED
void setup() {
pinMode(boton1Pin, INPUT_PULLUP); // Configurar el botón 1 como entrada con pull-up
pinMode(boton2Pin, INPUT_PULLUP); // Configurar el botón 2 como entrada con pull-up
pinMode(ledPin, OUTPUT); // Configurar el LED como salida
}
void loop() {
// Leer el estado de los botones (LOW cuando se presiona debido al pull-up)
int estadoBoton1 = digitalRead(boton1Pin);
int estadoBoton2 = digitalRead(boton2Pin);
// Verificar si ambos botones están presionados simultáneamente (ambos en LOW)
if (estadoBoton1 == LOW && estadoBoton2 == LOW) {
// Encender el LED
digitalWrite(ledPin, HIGH);
} else {
// Apagar el LED
digitalWrite(ledPin, LOW);
}
}