Skip to content

Commit

Permalink
Use INPUT_PULLUP instead of INPUT
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
leochen4891 authored Dec 15, 2024
1 parent 64b62dc commit 2c7b76a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/ESP32/examples/Timer/RepeatTimer/RepeatTimer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 2c7b76a

Please sign in to comment.