Change debounce interval checking to handle millis wrap around
This commit is contained in:
parent
0f388e004f
commit
945a46cde4
|
|
@ -79,7 +79,7 @@ void loop() {
|
|||
debouncing = true;
|
||||
lastDebounceTime = currentMillis;
|
||||
}
|
||||
if ( debouncing && (currentMillis >= (lastDebounceTime + DEBOUNCEMS)) ) {
|
||||
if ( debouncing && ((currentMillis - lastDebounceTime) >= DEBOUNCEMS) ) {
|
||||
debouncing = false;
|
||||
if ( buttonCheck != buttonState ) {
|
||||
buttonState = buttonCheck;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user