Skip to content

Commit

Permalink
press button D0(flash) to reset rather than rst, or the mpu6050's int…
Browse files Browse the repository at this point in the history
…errupt cause bugs
  • Loading branch information
Zhaosn committed Jan 29, 2024
1 parent c9e825c commit c92477b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ bool saveConfigSPIFFS() {
void checkButton(){
// check for button press
if ( digitalRead(TRIGGER_PIN) == LOW ) {
noInterrupts();
// poor mans debounce/press-hold, code not ideal for production
delay(50);
if( digitalRead(TRIGGER_PIN) == LOW ){
Expand All @@ -319,6 +320,7 @@ void checkButton(){
ESP.restart();
}
}
interrupts();
}
}

Expand Down

0 comments on commit c92477b

Please sign in to comment.