Browse Source

Charge / charging test modified.

master
klaute 3 years ago
parent
commit
c2f1571305
  1. BIN
      doc/NODEMCU_DEVKIT_V1.0.PDF
  2. 2
      firmware/config.h
  3. 10
      firmware/firmware.ino
  4. 10
      firmware/sensors.ino

BIN
doc/NODEMCU_DEVKIT_V1.0.PDF

Binary file not shown.

2
firmware/config.h

@ -43,4 +43,4 @@
#define INITIAL_WEBSERVER_TIME 20
#endif
#endif

10
firmware/firmware.ino

@ -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);

10
firmware/sensors.ino

@ -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…
Cancel
Save