Charge / charging test modified.
This commit is contained in:
parent
808cf6a40d
commit
c2f1571305
4 changed files with 11 additions and 11 deletions
BIN
doc/NODEMCU_DEVKIT_V1.0.PDF
Executable file
BIN
doc/NODEMCU_DEVKIT_V1.0.PDF
Executable file
Binary file not shown.
2
firmware/config.h
Normal file → Executable file
2
firmware/config.h
Normal file → Executable file
|
@ -43,4 +43,4 @@
|
|||
|
||||
#define INITIAL_WEBSERVER_TIME 20
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -63,16 +63,16 @@ 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;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue