X-Git-Url: http://git.piffa.net/web?a=blobdiff_plain;f=basic%2Fbuttons%2Fbutton_presses_count_down_5%2Fbutton_presses_count_down_5.ino;h=2a26de673542c3f83fc8c2147be81775fd13d5ca;hb=fa3554ca7f433786f4f65bd266f0a356a89bed0b;hp=7e43837c9777ee7b15c85647f2b5732516824f82;hpb=6a0496fdc97f180319df0a3270d1a78920e7ec32;p=sketchbook_andrea diff --git a/basic/buttons/button_presses_count_down_5/button_presses_count_down_5.ino b/basic/buttons/button_presses_count_down_5/button_presses_count_down_5.ino index 7e43837..2a26de6 100644 --- a/basic/buttons/button_presses_count_down_5/button_presses_count_down_5.ino +++ b/basic/buttons/button_presses_count_down_5/button_presses_count_down_5.ino @@ -1,11 +1,16 @@ /* - * Alternating switch + * Contatore di input + + Il programma rileva la pressione del bottone e + riduce un contatore ad ogni pressione, + passando dallo stato iniziale a un secondo stato finale + dopo 10 iterazioni. */ int switchPin = 2; // switch is connected to pin 2 int val; // variable for reading the pin status int buttonState; // variable to hold the last button state -int buttonPresses = 10; // Counter for the button +int buttonPresses = 10; // Counter for the button void setup() { pinMode(switchPin, INPUT_PULLUP); // Set the switch pin as input