From f057c443616c09bfc237d6873520fe353d01678f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Kub=C3=AD=C4=8Dek?= Date: Wed, 10 Jun 2026 09:03:55 +0200 Subject: [PATCH] =?UTF-8?q?odebr=C3=A1n=C3=AD=20zbyte=C4=8Dn=C3=BDch=20kom?= =?UTF-8?q?ent=C3=A1=C5=99=C5=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/src/main.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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; } }