Update 'firmware/firmware.ino'
Added undervoltage preventing deep sleep to setup function.
This commit is contained in:
parent
e3a9ecc595
commit
984dfc07dd
1 changed files with 8 additions and 0 deletions
|
@ -106,6 +106,14 @@ void setup() {
|
||||||
|
|
||||||
digitalWrite(STATUS_LED_PIN, LOW);
|
digitalWrite(STATUS_LED_PIN, LOW);
|
||||||
|
|
||||||
|
if (currentSensorData[SENSOR_BAT_VOLTAGE] <= 3.4)
|
||||||
|
{
|
||||||
|
#ifdef DEBUG
|
||||||
|
Serial.println("Low battery, going into deep sleep.");
|
||||||
|
#endif
|
||||||
|
ESP.deepSleep(4294967295); // battery low, shutting down
|
||||||
|
}
|
||||||
|
|
||||||
WiFi.mode(WIFI_OFF);
|
WiFi.mode(WIFI_OFF);
|
||||||
WiFi.forceSleepBegin();
|
WiFi.forceSleepBegin();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue