#define PINLED 13
#define PINBTNvite 2
#define PINBTNlent 3
int led_STAT=LOW;
int tempo=1000;
void IsrPinBtnvite ();
void IsrPinBtnlent ();
void setup() {
pinMode(PINLED, OUTPUT);
pinMode(PINBTNvite, INPUT_PULLUP);
pinMode(PINBTNlent, INPUT_PULLUP);
digitalWrite(PINLED,led_STAT);
attachInterrupt(digitalPinToInterrupt(PINBTNvite), IsrPinBtnvite, FALLING);
attachInterrupt(digitalPinToInterrupt(PINBTNlent), IsrPinBtnlent, FALLING);
}
void loop() {
// des choses utile s
digitalWrite(PINLED, HIGH); // turn the LED on (HIGH is the voltage level)
delay(tempo); // wait for a second
digitalWrite(PINLED, LOW); // turn the LED off by making the voltage LOW
delay(tempo); // wait for a second
}
void IsrPinBtnvite ()
{
tempo=tempo-100;
if (tempo<=0) tempo=100;
}
void IsrPinBtnlent ()
{
tempo=tempo+100;
if (tempo>5000) tempo=5000;
}