From 82927519cec235a40a9aa54829e67f746606516e Mon Sep 17 00:00:00 2001 From: Anna Wiggins Date: Tue, 21 Dec 2021 04:30:20 +0000 Subject: [PATCH] Fix off-by-one error. --- Button.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Button.cpp b/Button.cpp index cb9a057..4fbe3d9 100644 --- a/Button.cpp +++ b/Button.cpp @@ -133,13 +133,13 @@ bool EncoderButton::Update(Joystick* js) { ticks--; } - if (ticks > tick_threshold) { + if (ticks >= tick_threshold) { js->PressButton(vbutton); changed = true; release_time1 = millis() + 250; ticks = 0; } - else if (ticks < tick_threshold * -1) { + else if (ticks <= tick_threshold * -1) { js->PressButton(vbutton2); changed = true; release_time2 = millis() + 250;