const int BTN_ON = 12; // Pull-up: Presionado => LOW
const int BTN_OFF = 3; // Pull-down: Presionado => HIGH
void setup() {
Serial.begin(115200);
pinMode(LED_BUILTIN, OUTPUT);
pinMode(BTN_ON, INPUT);
pinMode(BTN_OFF, INPUT);
}
void loop() {
int est_on = digitalRead(BTN_ON);
int est_off = digitalRead(BTN_OFF);
if(est_on == LOW) { // on presionado?
digitalWrite(LED_BUILTIN, HIGH);
Serial.println("LED PRENDIDO");
}
if(est_off == HIGH) { // off presionado?
digitalWrite(LED_BUILTIN, LOW);
Serial.println("LED APAGADO");
}
}