delay(20); // riduce l'effetto bounce
if (statoAttuale != ultimoStato) { // lo stato del bottone e' cambiato
if (statoAttuale == HIGH) { // il bottone e' stato premuto
delay(20); // riduce l'effetto bounce
if (statoAttuale != ultimoStato) { // lo stato del bottone e' cambiato
if (statoAttuale == HIGH) { // il bottone e' stato premuto