diff --git a/src/src/main.cpp b/src/src/main.cpp index 2682ee7..03f9e0e 100644 --- a/src/src/main.cpp +++ b/src/src/main.cpp @@ -6,7 +6,7 @@ // piny constexpr byte ENCODER_CLK_PIN = 11; constexpr byte ENCODER_DT_PIN = 12; -constexpr byte BUTTON_PIN = 2; // ZMĚNA: přesunuto na pin 2 (INT0) kvůli přerušení +constexpr byte BUTTON_PIN = 2; constexpr byte RGB_RED_PIN = 3; constexpr byte RGB_GREEN_PIN = 5; constexpr byte RGB_BLUE_PIN = 6; @@ -221,7 +221,7 @@ void setup() { lcd.printstr("Piny nastaveny. "); delay(1000); - // registrace přerušení – RISING: stisk při HIGH (INPUT_PULLDOWN) + // registrace přerušení attachInterrupt(digitalPinToInterrupt(BUTTON_PIN), onButtonPress, RISING); runPasswordSetup(); @@ -231,9 +231,8 @@ void loop() { if (buttonPressed) { if (millis() - buttonPressTime >= DEBOUNCE_MS) { buttonPressed = false; - // handle the press } else { - buttonPressed = false; // too fast, ignore + buttonPressed = false; } }