Arduino icon indicating copy to clipboard operation
Arduino copied to clipboard

Correction in the "BlinkWithoutDelay" example. [imported]

Open cmaglie opened this issue 14 years ago • 1 comments

This is Issue 991 moved from a Google Code project. Added by 2012-07-24T00:17:44.000Z by [email protected]. Please review that bug for more context and additional comments, but update this bug.

Original labels: Type-Enhancement, Priority-Medium

Original description

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"

cmaglie avatar Nov 15 '12 18:11 cmaglie

The example demonstrates the desired behavior fine as is.

shfitz avatar Apr 01 '13 16:04 shfitz