3 Accensione e spegnimanto di un LED utilizzando un ciclo
4 iterativo while per comandare il lampeggio.
6 This example code is in the public domain.
9 // Pin 13 has an LED connected on most Arduino boards.
12 int breve = 200; // Variabile richiambile nel corso dell'esecuzione
15 // the setup routine runs once when you press reset:
17 // initialize the digital pin as an output.
21 // the loop routine runs over and over again forever:
23 int iterator = 0; // Defniamo un variabile per controllare un ciclo iterativo
24 while (iterator <10) {
25 rapido(); // accende e spegne rapidamente il LED
26 iterator = iterator + 1 ; // incrementa l'iteratore
27 // iterator++ ; // equivalente
29 lento(); // accende e spegne lentamente il LED
32 // Funzioni create dall'utente:
35 // Accende e spegne rapidamente il LED
37 // sequenze di istruzione: accendere e spegnere il LED
38 digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
39 delay(breve); // wait for a second
40 digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
41 delay(breve); // wait for a second
45 // Accende e spegne lentamente il LED
47 // sequenze di istruzione: accendere e spegnere il LED
48 digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
49 delay(lunga); // wait for a second
50 digitalWrite(led, LOW); // turn the LED off by making the voltage LOW