diff options
Diffstat (limited to 'wirish/wirish_digital.cpp')
-rw-r--r-- | wirish/wirish_digital.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/wirish/wirish_digital.cpp b/wirish/wirish_digital.cpp index 05ce756..2711a33 100644 --- a/wirish/wirish_digital.cpp +++ b/wirish/wirish_digital.cpp @@ -64,10 +64,10 @@ void togglePin(uint8 pin) { #define BUTTON_DEBOUNCE_DELAY 1 -uint8 isButtonPressed() { - if (digitalRead(BOARD_BUTTON_PIN) == BOARD_BUTTON_PRESSED_LEVEL) { +uint8 isButtonPressed(uint8 pin, uint32 pressedLevel) { + if (digitalRead(pin) == pressedLevel) { delay(BUTTON_DEBOUNCE_DELAY); - while (digitalRead(BOARD_BUTTON_PIN) == BOARD_BUTTON_PRESSED_LEVEL) + while (digitalRead(pin) == pressedLevel) ; return true; } |