odebrání zbytečných komentářů
This commit is contained in:
+3
-4
@@ -6,7 +6,7 @@
|
|||||||
// piny
|
// piny
|
||||||
constexpr byte ENCODER_CLK_PIN = 11;
|
constexpr byte ENCODER_CLK_PIN = 11;
|
||||||
constexpr byte ENCODER_DT_PIN = 12;
|
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_RED_PIN = 3;
|
||||||
constexpr byte RGB_GREEN_PIN = 5;
|
constexpr byte RGB_GREEN_PIN = 5;
|
||||||
constexpr byte RGB_BLUE_PIN = 6;
|
constexpr byte RGB_BLUE_PIN = 6;
|
||||||
@@ -221,7 +221,7 @@ void setup() {
|
|||||||
lcd.printstr("Piny nastaveny. ");
|
lcd.printstr("Piny nastaveny. ");
|
||||||
delay(1000);
|
delay(1000);
|
||||||
|
|
||||||
// registrace přerušení – RISING: stisk při HIGH (INPUT_PULLDOWN)
|
// registrace přerušení
|
||||||
attachInterrupt(digitalPinToInterrupt(BUTTON_PIN), onButtonPress, RISING);
|
attachInterrupt(digitalPinToInterrupt(BUTTON_PIN), onButtonPress, RISING);
|
||||||
|
|
||||||
runPasswordSetup();
|
runPasswordSetup();
|
||||||
@@ -231,9 +231,8 @@ void loop() {
|
|||||||
if (buttonPressed) {
|
if (buttonPressed) {
|
||||||
if (millis() - buttonPressTime >= DEBOUNCE_MS) {
|
if (millis() - buttonPressTime >= DEBOUNCE_MS) {
|
||||||
buttonPressed = false;
|
buttonPressed = false;
|
||||||
// handle the press
|
|
||||||
} else {
|
} else {
|
||||||
buttonPressed = false; // too fast, ignore
|
buttonPressed = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user