]> git.piffa.net Git - sketchbook_andrea/blobdiff - basic/blinks/blink_3_ciclo_while/blink_3_ciclo_while.ino
blinks while
[sketchbook_andrea] / basic / blinks / blink_3_ciclo_while / blink_3_ciclo_while.ino
index ff8dea5eda33db47e4a173e3f4bf0cf60439de9f..ceb3cfee074051e40cd471c1d1a68fef55f4302b 100644 (file)
@@ -11,7 +11,6 @@
 int led = 13;
 int breve = 200;  // Variabile richiambile nel corso dell'esecuzione
 int lunga = 1000;
-int iterator = 0; // Defniamo un variabile per controllare un ciclo iterativo
 
 // the setup routine runs once when you press reset:
 void setup() {                
@@ -21,13 +20,13 @@ void setup() {
 
 // the loop routine runs over and over again forever:
 void loop() {
+  int iterator = 0; // Defniamo un variabile per controllare un ciclo iterativo
   while (iterator <10) {
     rapido(); // accende e spegne rapidamente il LED
-    iterator = iterator +1 ; // incrementa l'iteratore
+    iterator = iterator + 1 ; // incrementa l'iteratore
     // iterator++ ; // equivalente
   }
   lento();  // accende e spegne lentamente il LED
-  // Domanda: a quanto equivale iterator ora?
 }
 
 // Funzioni create dall'utente:
@@ -54,3 +53,4 @@ void lento() {
 
 
 
+