Skip to content

Commit

Permalink
Fix bug in physical start/stop button
Browse files Browse the repository at this point in the history
  • Loading branch information
xeonqq committed Apr 16, 2023
1 parent 7c90a58 commit e37d927
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,15 @@ void delayedStartFeeding(uint32_t delay_ms) {
void onStartStopButtonPressed() {
if (!button_read_timer.isStarted()) {
button_read_timer
.initializeMs(50,
.initializeMs(100,
[&]() {
auto button_status = digitalRead(StartStopButtonPin);
Serial << micros() << _F(" Pin changed, now ")
<< button_status << endl;
if (button_status == LOW) { // start feeding
delayedStartFeeding(StartStopPressedToFeedingDelayMs);
} else {
delay_timer.stop();
TransitionTo(State::Stop);
}
button_read_timer.stop();
Expand Down

0 comments on commit e37d927

Please sign in to comment.