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;
|
debouncing = true;
|
||||||
lastDebounceTime = currentMillis;
|
lastDebounceTime = currentMillis;
|
||||||
}
|
}
|
||||||
if ( debouncing && (currentMillis >= (lastDebounceTime + DEBOUNCEMS)) ) {
|
if ( debouncing && ((currentMillis - lastDebounceTime) >= DEBOUNCEMS) ) {
|
||||||
debouncing = false;
|
debouncing = false;
|
||||||
if ( buttonCheck != buttonState ) {
|
if ( buttonCheck != buttonState ) {
|
||||||
buttonState = buttonCheck;
|
buttonState = buttonCheck;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user