From 2c7b76aea8e3c87360f32d61b7916ff4178f3f68 Mon Sep 17 00:00:00 2001 From: Lei Chen Date: Sun, 15 Dec 2024 12:19:49 -0500 Subject: [PATCH] Use INPUT_PULLUP instead of INPUT Tested on some of the popular S3 board bought from Amazon, the digitalRead of an INPUT pin is LOW, which stops the timer right after start. Setting it to INPUT_PULLUP will fix it. --- libraries/ESP32/examples/Timer/RepeatTimer/RepeatTimer.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/ESP32/examples/Timer/RepeatTimer/RepeatTimer.ino b/libraries/ESP32/examples/Timer/RepeatTimer/RepeatTimer.ino index 18fdc8035a5..e4ef7bc865b 100644 --- a/libraries/ESP32/examples/Timer/RepeatTimer/RepeatTimer.ino +++ b/libraries/ESP32/examples/Timer/RepeatTimer/RepeatTimer.ino @@ -33,7 +33,7 @@ void setup() { Serial.begin(115200); // Set BTN_STOP_ALARM to input mode - pinMode(BTN_STOP_ALARM, INPUT); + pinMode(BTN_STOP_ALARM, INPUT_PULLUP); // Create semaphore to inform us when the timer has fired timerSemaphore = xSemaphoreCreateBinary();