dj0tt / arduino

Automatically exported from code.google.com/p/arduino
Other
0 stars 0 forks source link

Correction in the "BlinkWithoutDelay" example. #991

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Actually on line 53 is used "previousMillis = currentMillis".
But between the "if(currentMillis.." and the "previousMillis = .."  there may 
be delays.
Delays may occour even before the "if(currentMillis...)
The result is that in 1000 seconds the sketch will make less than 1000 blinks 

I think the right solution is to use "previousMillis = previousMillis + delay" 
in line 53.

I hope to see the note "modified 22lug 2012 by Alex Limbeck"

Original issue reported on code.google.com by alex.lim...@gmail.com on 24 Jul 2012 at 12:17

GoogleCodeExporter commented 9 years ago
The example demonstrates the desired behavior as is.

Original comment by s.fitzge...@arduino.cc on 2 Apr 2013 at 9:01