4 Utilizzare un interrupt per intercettare
5 l'input di un interruttore momentaneo
10 volatile int state = LOW;
14 pinMode(ledPin, OUTPUT);
15 pinMode(2, INPUT_PULLUP);
16 attachInterrupt(0, blink, FALLING);
21 //digitalWrite(ledPin, state);
22 delay(10000); // Mette in pausa Arduino per 10sec
27 // Modifica dello stato del LED
30 digitalWrite(ledPin, state);