Included some code from @dakarym to support the self powered board for testing

This commit is contained in:
Gunnar Skjold
2020-01-22 15:26:07 +01:00
parent 0fa3e3585a
commit 8ee713b616

View File

@@ -4,9 +4,7 @@
Author: roarf
*/
//#define HAS_DALLAS_TEMP_SENSOR 1 // Set to zero if Dallas one wire temp sensor is not present
//#define IS_CUSTOM_AMS_BOARD 1 // Set to zero if using NodeMCU or board not designed by Roar Fredriksen
ADC_MODE(ADC_VCC);
#include <ArduinoJson.h>
#include <MQTT.h>
@@ -77,6 +75,15 @@ void setup() {
debugger->println("Started...");
}
if (ESP.getVcc() < 3300) {
if(debugger) {
debugger->print("Voltage is too low: ");
debugger->print(ESP.getVcc());
debugger->println("v");
}
ESP.deepSleep(5000000); //Deep sleep for 5 seconds to allow output cap to charge up
}
// Flash the LED, to indicate we can boot as AP now
pinMode(LED_PIN, OUTPUT);
led_on();