From 03a8f9cc6376dd94b70e04b7b1b199678921ff82 Mon Sep 17 00:00:00 2001 From: tcmal Date: Sun, 9 Feb 2025 18:46:16 +0000 Subject: [PATCH] Make it a bark switch instead --- src/main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index ad91fa5..49457d4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -49,6 +49,8 @@ void setup() { pinMode(BUTTON_PIN, INPUT_PULLUP); pinMode(LED_PIN, OUTPUT); + + randomSeed(analogRead(0)); } // Wait for button press @@ -56,10 +58,10 @@ void loop() { mqttClient.loop(); int buttonState = digitalRead(BUTTON_PIN); - if (buttonState != lastButtonState && buttonState == LOW) { + if (buttonState == LOW) { digitalWrite(LED_PIN, HIGH); buttonPress(); - delay(100); + delay(3000); digitalWrite(LED_PIN, LOW); } lastButtonState = buttonState; -- 2.51.2