const int buttonPinEncender = 15; // Botón que enciende el LED
const int buttonPinApagar = 16; // Botón que apaga el LED
void IRAM_ATTR encenderLED() {
digitalWrite(4, HIGH);
}
void IRAM_ATTR apagarLED() {
digitalWrite(4, LOW);
}
void setup() {
pinMode(buttonPinEncender, INPUT_PULLUP);
pinMode(buttonPinApagar, INPUT_PULLUP);
pinMode(4, OUTPUT); // LED que se enciende y apaga con botones
pinMode(17, OUTPUT); // LED que parpadea
attachInterrupt(digitalPinToInterrupt(buttonPinEncender), encenderLED, FALLING);
attachInterrupt(digitalPinToInterrupt(buttonPinApagar), apagarLED, RISING);
Serial.begin(115200);
}
void loop() {
// LED que parpadea continuamente
digitalWrite(17, HIGH);
delay(2000);
digitalWrite(17, LOW);
delay(2000);
}