// Definición de pines de switches
const int switch1 = 15;
const int switch2 = 2;
const int switch3 = 0;
const int switch4 = 4;
const int led = 16; // Pin del LED
void setup() {
// Configurar pines de entrada con resistencia pull-up interna
pinMode(switch1, INPUT_PULLUP); // Configurar switches como entrada con pull-up
pinMode(switch2, INPUT_PULLUP);
pinMode(switch3, INPUT_PULLUP);
pinMode(switch4, INPUT_PULLUP);
pinMode(led, OUTPUT); // Configurar LED como salida
}
void loop() {
// Leer el estado de los switches
int estadoSwitch1 = digitalRead(switch1);
int estadoSwitch2 = digitalRead(switch2);
int estadoSwitch3 = digitalRead(switch3);
int estadoSwitch4 = digitalRead(switch4);
// Encender el LED si cualquiera de los switches está encendido
if (estadoSwitch1 == HIGH, estadoSwitch2 == HIGH, estadoSwitch3 == HIGH, estadoSwitch4 ==HIGH) {
digitalWrite(led, HIGH); // Encender LED
} else {
digitalWrite(led, LOW); // Apagar LED
}
}