23#include <TinyGsmClient.h>
24#include <esp32-hal-adc.h>
30#define LOW_VOLTAGE_LEVEL 3600
31#define WARN_VOLTAGE_LEVEL 3700
32#define SLEEP_MINUTE 60
37 static uint32_t getBatteryVoltageAverage();
void turnOffPower(int pin)
Turns off the power pin.
Definition battery.cpp:185
void turnOnPower(int pin)
Turns on the power pin.
Definition battery.cpp:173
void deepSleep(uint32_t ms)
Puts the device into deep sleep mode for a specified duration.
Definition battery.cpp:224
void getUpdate()
Gets the battery update every 10 seconds.
Definition battery.cpp:155
bool isPowerOn(int pin)
Checks if the power pin is on.
Definition battery.cpp:199
float readVoltage()
Reads the battery voltage in volts.
Definition battery.cpp:108
void setRGB(int percent)
Sets the RGB LED color based on battery percentage.
Definition battery.cpp:248
int percent()
Gets the battery percentage based on the voltage.
Definition battery.cpp:119
float getBatteryStatus()
Gets the battery status as a percentage based on the voltage.
Definition battery.cpp:130
uint32_t getBatteryVoltage()
Gets the current battery voltage in millivolts.
Definition battery.cpp:98
void safetyShutdown()
Initiates a safety shutdown due to low battery voltage.
Definition battery.cpp:212
void powerSaveMode()
Enters power save mode by putting the device into deep sleep for a short duration.
Definition battery.cpp:235
void begin()
Initializes the battery monitoring system.
Definition battery.cpp:26
Configuration Header File.