-
Notifications
You must be signed in to change notification settings - Fork 792
class_tiny_gsm_battery
Sara Damiano edited this page Sep 11, 2026
·
2 revisions
Module: TinyGsmBattery
The CRTP parent class for battery functions.
#include <src/TinyGsmBattery.tpp>
| Name | |
|---|---|
| int16_t |
getBattVoltage() Get the current battery voltage. |
| int8_t |
getBattPercent() Get the current battery percent. |
| int8_t |
getBattChargeState() Get the battery charging state. |
| bool |
getBattStats(int8_t & chargeState, int8_t & percent, int16_t & milliVolts) Get the all battery state. |
int16_t getBattVoltage()
Note
Unless you have a battery directly connected to your modem module, this will be the input voltage going to the module from your main processor board, not the battery voltage of your main processor.
- Return: The battery voltage measured by the modem module.
int8_t getBattPercent()
Note
Unless you have a battery directly connected to your modem module, this will be the percent from the input voltage going to the module from your main processor board, not the battery percent of your main processor.
- Return: The current battery percent.
int8_t getBattChargeState()
- Return: The battery charge state.
bool getBattStats(int8_t & chargeState, int8_t & percent, int16_t & milliVolts)
-
Parameters:
- chargeState A reference to an int to set to the battery charge state
- percent A reference to an int to set to the battery percent
- milliVolts A reference to an int to set to the battery voltage
- Return: True if the battery stats were updated by the module, false otherwise.
Generated by Doxygen and m.css with templates from doxybook2 Updated on 2026-09-11
If you like TinyGSM library - give it a star, or fork it and contribute!