Closed
Description
In the 'Debounce' example provided with the IDE, under "File >Examples >Digital", the value of 'millis()' is stored in a 'long' variable type, which is not large enough:-
long lastDebounceTime = 0; // the last time the output pin was toggled
// then:-
lastDebounceTime = millis();
It should be stored in an 'unsigned long'.
As a result of this error, many new users have picked up the same bad habit.
Is it possible to have that example modified, and 'long' replaced by 'unsigned long'?
This would save many new users from potential hard-to-detect problems if their code runs for long periods.
Thanks,
... Steve
Metadata
Metadata
Assignees
Labels
No labels