Compare commits
3 Commits
9d36a75875
...
945a46cde4
| Author | SHA1 | Date | |
|---|---|---|---|
| 945a46cde4 | |||
| 0f388e004f | |||
| 3104324a30 |
|
|
@ -28,12 +28,12 @@ unsigned long lastStatusTime = 0;
|
|||
void sendActionMessage(bool state) {
|
||||
if ( DEBUG ) Serial.println("Action button triggered");
|
||||
String msgURL = actionURL + (state ? "true" : "false");
|
||||
WiFiClient client;
|
||||
HTTPClient http;
|
||||
if ( BOARD == "ESP32" ) {
|
||||
msgURL = "http://" + hostAddress + ":" + String(hostPort) + msgURL;
|
||||
http.begin(msgURL.c_str());
|
||||
} else {
|
||||
WiFiClient client;
|
||||
http.begin(client, hostAddress.c_str(), hostPort, msgURL.c_str());
|
||||
}
|
||||
http.GET();
|
||||
|
|
@ -79,7 +79,7 @@ void loop() {
|
|||
debouncing = true;
|
||||
lastDebounceTime = currentMillis;
|
||||
}
|
||||
if ( debouncing && (currentMillis >= (lastDebounceTime + DEBOUNCEMS)) ) {
|
||||
if ( debouncing && ((currentMillis - lastDebounceTime) >= DEBOUNCEMS) ) {
|
||||
debouncing = false;
|
||||
if ( buttonCheck != buttonState ) {
|
||||
buttonState = buttonCheck;
|
||||
|
|
@ -91,4 +91,5 @@ void loop() {
|
|||
}
|
||||
lastButtonState = buttonCheck;
|
||||
ArduinoOTA.handle();
|
||||
yield();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user