X-Git-Url: http://git.piffa.net/web?a=blobdiff_plain;f=basic%2Fbuttons%2Fbutton_state_4_state%2Fbutton_state_4_state.ino;fp=basic%2Fbuttons%2Fbutton_state_4_state%2Fbutton_state_4_state.ino;h=30a330bf05eb198e6aae98a105809884771959c2;hb=396bfe3bf6c89e468fd7a935d7be3a7d00cba04b;hp=d21f27ea37ba1fe57409070c47ba8ac4d9154829;hpb=8358fa5a102089baa511a66a7b56fd863ba652b0;p=sketchbook_andrea diff --git a/basic/buttons/button_state_4_state/button_state_4_state.ino b/basic/buttons/button_state_4_state/button_state_4_state.ino index d21f27e..30a330b 100644 --- a/basic/buttons/button_state_4_state/button_state_4_state.ino +++ b/basic/buttons/button_state_4_state/button_state_4_state.ino @@ -20,7 +20,8 @@ void setup() { } void loop(){ - statoAttuale = digitalRead(buttonPin); // Legge lo stato del bottone e lo registra in val + statoAttuale = digitalRead(buttonPin); // Legge lo stato del bottone e + // lo registra nella variabile delay(20); // riduce l'effetto bounce if (statoAttuale != ultimoStato) { // lo stato del bottone e' cambiato if (statoAttuale == HIGH) { // il bottone e' stato premuto