[FIX] use correct digital pin number constant + do not deep sleep, if the lights are on
This commit is contained in:
parent
0098c7aaaf
commit
026ca60835
|
@ -12,7 +12,7 @@ const char* host = "ursaminor.local";
|
||||||
String serviceUri = "/service.php";
|
String serviceUri = "/service.php";
|
||||||
const int httpPort = 8088;
|
const int httpPort = 8088;
|
||||||
|
|
||||||
const int relaisPin = 3;
|
const int relaisPin = D3;
|
||||||
|
|
||||||
bool lightState = false;
|
bool lightState = false;
|
||||||
unsigned int lightTime = 0;
|
unsigned int lightTime = 0;
|
||||||
|
@ -121,7 +121,7 @@ void loop() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// only deep sleep, if the time is more than 5 minutes
|
// 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("going for a deep sleep");
|
||||||
Serial.println("");
|
Serial.println("");
|
||||||
Serial.flush();
|
Serial.flush();
|
||||||
|
|
Reference in a new issue