From c7ece609ea35e0a9bd83f0af8f73c1c0e9e1b9c9 Mon Sep 17 00:00:00 2001 From: Junior Date: Tue, 8 Apr 2025 19:43:17 -0400 Subject: [PATCH] Change the word toggle to action --- src/main.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 1c1d87d..0be86a5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -12,7 +12,7 @@ #define SERVICE "LEDsActionButton" #define STATUSINTERVAL 600000 -String toggleURL = "http://moon.basement.lan/l/actionbutton.php?state="; +String actionURL = "http://moon.basement.lan/l/actionbutton.php?state="; String statusURL = "http://moon.basement.lan/l/boardstatus.php"; unsigned short buttonState = HIGH, lastButtonState = HIGH; unsigned long lastStatusTime = 0; @@ -20,10 +20,10 @@ unsigned long lastStatusTime = 0; AsyncWebServer server(80); PrettyOTA OTAUpdates; -void sendToggleMessage(bool state) { +void sendActionMessage(bool state) { Serial.println("Action button triggered"); char webMsg[255] = ""; - strcat(webMsg, toggleURL.c_str()); + strcat(webMsg, actionURL.c_str()); strcat(webMsg, (state) ? "true" : "false"); HTTPClient http; http.begin(webMsg); @@ -86,7 +86,7 @@ void setup() { } unsigned long lastDebounceTime = 0; -bool toggleState = false; +bool actionState = false; bool debouncing = false; void loop() { if ( millis() > (lastStatusTime + STATUSINTERVAL) ) { @@ -105,8 +105,8 @@ void loop() { if ( buttonCheck != buttonState ) { buttonState = buttonCheck; if ( buttonState == LOW ) { - toggleState = !toggleState; - sendToggleMessage(toggleState); + actionState = !actionState; + sendActionMessage(actionState); } } }