]> git.piffa.net Git - sketchbook_andrea/blobdiff - multitasking/BlinkWithoutDelay_3_funzione/BlinkWithoutDelay_3_funzione.ino
Multitasking
[sketchbook_andrea] / multitasking / BlinkWithoutDelay_3_funzione / BlinkWithoutDelay_3_funzione.ino
index 63a324e9264388cf8c1e846aa43773777ad83a50..a5db67b3cb71611d4bb69ac263eb2358e86070fd 100644 (file)
@@ -19,6 +19,7 @@ long previousMillisA = 0;        // will store last time LED was updated
 // the follow variables is a long because the time, measured in miliseconds,
 // will quickly become a bigger number than can be stored in an int.
 long intervalA = 1000;           // interval at which to blink (milliseconds)
+void lightLedA () ;
 
 //////////////
 // Second LED
@@ -26,6 +27,7 @@ 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)
+void lightLedB () ;
 
 
 void setup() {
@@ -61,7 +63,7 @@ void lightLedA () {
 
 void lightLedB () {
   long intervalB = 500;
-   static int ledStateB ;  
+   static int ledStateB ;  // https://www.arduino.cc/en/Reference/Static
   if(millis() - previousMillisB > intervalB) {
     // save the last time you blinked the LED 
     previousMillisB = millis();