Replace tone() with custom timer

This commit is contained in:
cryptogopher
2022-10-09 20:34:25 +02:00
parent 374a72fb07
commit f8878d3c37
2 changed files with 30 additions and 10 deletions

View File

@@ -1,5 +1,7 @@
volatile unsigned long lastButtonPress = millis();
// Debouncing na timerze:
// https://github.com/khoih-prog/TimerInterrupt/blob/master/examples/SwitchDebounce/SwitchDebounce.ino
void initButton() {
pinMode(BUTTON_PIN, INPUT_PULLUP);
// Order of ISRs matter: RISING should be invoked first