From 329a228b2d3548ef9f3f31ef4cdaf2136d3f8fa7 Mon Sep 17 00:00:00 2001 From: Ollo Date: Sun, 1 Nov 2020 20:42:45 +0100 Subject: [PATCH] Toggle Sensor LED to visualize mode 3 --- esp32/src/main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/esp32/src/main.cpp b/esp32/src/main.cpp index 33aefdb..7020163 100644 --- a/esp32/src/main.cpp +++ b/esp32/src/main.cpp @@ -475,7 +475,6 @@ int determineNextPump(){ */ bool aliveHandler(const HomieRange& range, const String& value) { if (range.isRange) return false; // only one controller is present - Serial << value << endl; if (value.equals("ON") || value.equals("On") || value.equals("1")) { mode3Active=true; } else { @@ -674,4 +673,9 @@ void loop() { Serial.flush(); espDeepSleepFor(rtcDeepSleepTime); } + + /* Toggel Senor LED to visualize mode 3 */ + if (mode3Active && (millis() % 100) == 0) { + digitalWrite(OUTPUT_SENSOR, ! digitalRead(OUTPUT_SENSOR)); + } }