#define boton1 13
#define boton2 14
#define boton3 15
#define boton4 16
#define tiempo 500
int i=0;
int dato=0;
int tiempo_anterior=0;
void isr(){
if (!digitalRead(dato)) boton1 = 1;
else if (!digitalRead(dato)) boton2 = 2;
else if (!digitalRead(dato)) boton3 = 3;
else if (!digitalRead(dato)) boton4 = 4;
else dato = 0;
void setup() {
[Link](115200);
pinMode(boton1,INPUT_PULLDOWN);
pinMode(boton2,INPUT_PULLDOWN);
pinMode(boton3,INPUT_PULLDOWN);
pinMode(boton4,INPUT_PULLDOWN);
attachInterrupt(boton1,isr,RISING);//LOW,HIGH,CHANGE,RISING,FALLING
attachInterrupt(boton2,isr,RISING);
attachInterrupt(boton3,isr,RISING);
attachInterrupt(boton4,isr,RISING);
}
void loop() {
if (dato)
if (millis()-tiempo_anterior > tiermpo)
[Link]("¡Interrupción ");
[Link](dato);
tiempo_anterior = millis();
dato = 0;
[Link](i);
i=i+2;
delay(1000);