From d2e3dc8c90171e69def1a6d954c2a1b3209d076c Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Fri, 21 Jun 2024 20:55:32 +0700 Subject: [PATCH] adjust debounce and loop --- src/config.hpp | 4 ++-- src/main.cpp | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/config.hpp b/src/config.hpp index 30ab0de..756bc6a 100644 --- a/src/config.hpp +++ b/src/config.hpp @@ -7,8 +7,8 @@ #define RIGHT_OFF_BUTTON_PIN 1 #define LEFT_ON_BUTTON_PIN 2 #define LEFT_OFF_BUTTON_PIN 3 -#define BUTTON_SHORT_PRESS_TIME_MS 150 -#define BUTTON_LONG_PRESS_TIME_MS 2000 +#define BUTTON_SHORT_PRESS_TIME_MS 75 +#define BUTTON_LONG_PRESS_TIME_MS 600 #define RIGHT_LIGHT_RELAY_PIN 0 #define LEFT_LIGHT_RELAY_PIN 1 diff --git a/src/main.cpp b/src/main.cpp index 345c139..45953b7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -135,6 +135,10 @@ void button_init() void loop() { + leftOnButton.loop(); + leftOffButton.loop(); + rightOnButton.loop(); + rightOffButton.loop(); espmega.loop(); }