]> git.piffa.net Git - sketchbook_andrea/blobdiff - multitasking/BlinkWithoutDelay_1/BlinkWithoutDelay_1.ino
State machine e blinks con millis()
[sketchbook_andrea] / multitasking / BlinkWithoutDelay_1 / BlinkWithoutDelay_1.ino
index f7fee43e2b2d63d4f75d69ccc47ae5e54180c4ca..72a9694039bd500a5f25961f2c5390b428bf7ed9 100644 (file)
@@ -48,7 +48,7 @@ void loop()
   // the LED is bigger than the interval at which you want to 
   // blink the LED.
  
-  if(millis() - previousMillis > interval) {
+  if (millis() > previousMillis + interval) {
     // Aggiorniamo il contatore previousMillis
     previousMillis = millis();