From 026ca608359f32f3f9f542d39509f9cf2f40690b Mon Sep 17 00:00:00 2001 From: Jannik Beyerstedt Date: Fri, 28 Jul 2017 19:34:40 +0200 Subject: [PATCH] [FIX] use correct digital pin number constant + do not deep sleep, if the lights are on --- lightscontrol-client.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lightscontrol-client.ino b/lightscontrol-client.ino index 74ebcfc..a2f64b9 100644 --- a/lightscontrol-client.ino +++ b/lightscontrol-client.ino @@ -12,7 +12,7 @@ const char* host = "ursaminor.local"; String serviceUri = "/service.php"; const int httpPort = 8088; -const int relaisPin = 3; +const int relaisPin = D3; bool lightState = false; unsigned int lightTime = 0; @@ -121,7 +121,7 @@ void loop() { } // only deep sleep, if the time is more than 5 minutes - if (lightTime >= 5) { + if (lightTime >= 5 && lightState == false) { Serial.println("going for a deep sleep"); Serial.println(""); Serial.flush();