X-Git-Url: http://git.piffa.net/web?a=blobdiff_plain;f=multitasking%2FBlinkWithoutDelay_3_funzione%2FBlinkWithoutDelay_3_funzione.ino;h=63a324e9264388cf8c1e846aa43773777ad83a50;hb=f2798a8e8a34fac133b9f37b620af585ee33ba10;hp=5f5f2aba16ffdc510edffb190419135ae3f2704e;hpb=9612676f622de73bc823f0a4a0b1a0b1ab906a75;p=sketchbook_andrea diff --git a/multitasking/BlinkWithoutDelay_3_funzione/BlinkWithoutDelay_3_funzione.ino b/multitasking/BlinkWithoutDelay_3_funzione/BlinkWithoutDelay_3_funzione.ino index 5f5f2ab..63a324e 100644 --- a/multitasking/BlinkWithoutDelay_3_funzione/BlinkWithoutDelay_3_funzione.ino +++ b/multitasking/BlinkWithoutDelay_3_funzione/BlinkWithoutDelay_3_funzione.ino @@ -23,9 +23,9 @@ long intervalA = 1000; // interval at which to blink (milliseconds) ////////////// // Second LED int ledB = 12; //Secondo LED -int ledStateB = LOW; // ledState used to set the LED + // ledState used to set the LED long previousMillisB = 0; // will store last time LED was updated -long intervalB = 500; // interval at which to blink (milliseconds) + // interval at which to blink (milliseconds) void setup() { @@ -60,6 +60,8 @@ void lightLedA () { } void lightLedB () { + long intervalB = 500; + static int ledStateB ; if(millis() - previousMillisB > intervalB) { // save the last time you blinked the LED previousMillisB = millis();