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;