From 945a46cde4e7a8b517581ebceec0aeb9a2cd3e05 Mon Sep 17 00:00:00 2001 From: Junior Date: Tue, 10 Nov 2026 13:08:24 -0500 Subject: [PATCH] Change debounce interval checking to handle millis wrap around --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index c6aa86f..aaf25f8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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;