Battery charging states added.
This commit is contained in:
parent
87fe6c6e7a
commit
740bfc600b
3 changed files with 14 additions and 12 deletions
2
firmware/config.h
Normal file → Executable file
2
firmware/config.h
Normal file → Executable file
|
@ -31,6 +31,8 @@
|
|||
|
||||
#define STATUS_LED_PIN BUILTIN_LED
|
||||
#define ANEMOMETER_PIN D7
|
||||
#define BAT_CHARGED_PIN D6
|
||||
#define BAT_CHARGING_PIN D5
|
||||
|
||||
#define BME_SCK 13
|
||||
#define BME_MISO 12
|
||||
|
|
2
firmware/firmware.ino
Normal file → Executable file
2
firmware/firmware.ino
Normal file → Executable file
|
@ -75,7 +75,7 @@ void setup() {
|
|||
|
||||
if (!wifiManager.autoConnect(wifiName.c_str(), "DEADBEEF")) {
|
||||
#ifdef DEBUG
|
||||
Serial.println("WiFi connection failed, we reboot ...");
|
||||
Serial.println("WiFi connection failed, going into deep sleep ...");
|
||||
#endif
|
||||
// If autoconnect to WLAN failed and no client connected, go to deep sleep
|
||||
ESP.deepSleep(POWERSAVING_SLEEP_S * 1000000, WAKE_RF_DEFAULT);
|
||||
|
|
2
firmware/sensors.ino
Normal file → Executable file
2
firmware/sensors.ino
Normal file → Executable file
|
@ -62,7 +62,7 @@ float getBatteryVoltage() {
|
|||
return volt * 4.2;
|
||||
}
|
||||
|
||||
float isBatCompletelyCharged() {
|
||||
float isBatCharging() {
|
||||
if (HIGH == digitalRead(BAT_CHARGED_PIN))
|
||||
{
|
||||
return BAT_CHARGE_STATE_CHARGED;
|
||||
|
|
Loading…
Reference in a new issue