Skip to content

Commit 2c7b76a

Browse files
authored
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.
1 parent 64b62dc commit 2c7b76a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/ESP32/examples/Timer/RepeatTimer/RepeatTimer.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void setup() {
3333
Serial.begin(115200);
3434

3535
// Set BTN_STOP_ALARM to input mode
36-
pinMode(BTN_STOP_ALARM, INPUT);
36+
pinMode(BTN_STOP_ALARM, INPUT_PULLUP);
3737

3838
// Create semaphore to inform us when the timer has fired
3939
timerSemaphore = xSemaphoreCreateBinary();

0 commit comments

Comments
 (0)