aboutsummaryrefslogtreecommitdiffstats
path: root/wirish/wirish_digital.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'wirish/wirish_digital.cpp')
-rw-r--r--wirish/wirish_digital.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/wirish/wirish_digital.cpp b/wirish/wirish_digital.cpp
index a7f10cd..05ce756 100644
--- a/wirish/wirish_digital.cpp
+++ b/wirish/wirish_digital.cpp
@@ -65,9 +65,9 @@ void togglePin(uint8 pin) {
#define BUTTON_DEBOUNCE_DELAY 1
uint8 isButtonPressed() {
- if (digitalRead(BOARD_BUTTON_PIN)) {
+ if (digitalRead(BOARD_BUTTON_PIN) == BOARD_BUTTON_PRESSED_LEVEL) {
delay(BUTTON_DEBOUNCE_DELAY);
- while (digitalRead(BOARD_BUTTON_PIN))
+ while (digitalRead(BOARD_BUTTON_PIN) == BOARD_BUTTON_PRESSED_LEVEL)
;
return true;
}