Charge / charging test modified.

This commit is contained in:
klaute 2019-02-09 09:52:49 +01:00
parent 808cf6a40d
commit c2f1571305
4 changed files with 11 additions and 11 deletions

BIN
doc/NODEMCU_DEVKIT_V1.0.PDF Executable file

Binary file not shown.

0
firmware/config.h Normal file → Executable file
View File

View File

@ -1,3 +1,5 @@
// Standard ESP8266 libs
#include <ESP8266mDNS.h>
#include <ESP8266HTTPUpdateServer.h>
@ -68,11 +70,6 @@ String localIP = "127.0.0.1";
void setup() {
#ifdef BOARD_NODEMCU
// on nodemcu v0.1 (aliexpress) the delay is required to prevent a endless reboot bug
delay(100);
#endif
// Erase WiFi Credentials (maybe this will work ...)
//WiFi.disconnect(true);
//delay(2000);
@ -151,6 +148,9 @@ void setup() {
WiFi.mode(WIFI_OFF);
WiFi.forceSleepBegin();
#ifdef DEBUG
Serial.println("deep sleep");
#endif
// the ESP.deepSleep requires microseconds as input, after the sleep the system will run into the setup routine
ESP.deepSleep(POWERSAVING_SLEEP_S * 1000000, WAKE_RF_DEFAULT);
delay(100);

View File

@ -63,12 +63,12 @@ float getBatteryVoltage() {
}
float isBatCharging() {
if (LOW == digitalRead(BAT_CHARGED_PIN))
{
return BAT_CHARGE_STATE_CHARGED;
} else if (LOW == digitalRead(BAT_CHARGING_PIN))
if (LOW == digitalRead(BAT_CHARGING_PIN))
{
return BAT_CHARGE_STATE_CHARGING;
} else if (LOW == digitalRead(BAT_CHARGED_PIN))
{
return BAT_CHARGE_STATE_CHARGED;
}
return BAT_CHARGE_STATE_NOTCHARGING;