]> git.piffa.net Git - sketchbook_andrea/blobdiff - multitasking/BlinkWithoutDelay_3_funzione/BlinkWithoutDelay_3_funzione.ino
Millis
[sketchbook_andrea] / multitasking / BlinkWithoutDelay_3_funzione / BlinkWithoutDelay_3_funzione.ino
index a5db67b3cb71611d4bb69ac263eb2358e86070fd..93387bd7d4d174efdad86c442670b01dc1f028bd 100644 (file)
@@ -12,7 +12,7 @@
 
 /////////////
 // First LED
-int ledA =  13;      // the number of the LED pin
+const int ledA =  13;      // the number of the LED pin
 // Variables will change:
 int ledStateA = LOW;             // ledState used to set the LED
 long previousMillisA = 0;        // will store last time LED was updated
@@ -22,8 +22,9 @@ long intervalA = 1000;           // interval at which to blink (milliseconds)
 void lightLedA () ;
 
 //////////////
-// Second LED
-int ledB = 12; //Secondo LED
+//  Second LED
+// Now with less global variables thanks to static (see function body)
+const int ledB = 12; //Secondo LED
            // ledState used to set the LED
 long previousMillisB = 0;        // will store last time LED was updated
            // interval at which to blink (milliseconds)