WALL-E Battery Monitor Class that utilized the ADC to keep record of the current battery voltage to prevent low battery usage and battery life drain.
More...
#include <batteryMonitor.h>
|
| uint16_t | readVoltageRaw_mV () |
| | Function calculates the voltage in mV by reading the ADC and applying the conversion to step up to the appropriate input voltage.
|
WALL-E Battery Monitor Class that utilized the ADC to keep record of the current battery voltage to prevent low battery usage and battery life drain.
◆ BatteryMonitor()
| BatteryMonitor::BatteryMonitor |
( |
ADC_HandleTypeDef * | hadc, |
|
|
uint16_t | threshold_mV = 7000 ) |
Constructor Function for the Battery Monitor Class.
- Parameters
-
| hadc | ADC definition from the STM32 HAL Config |
| threshold_mV | Default value 7000 for 7V, indicates when battery levels are too low |
◆ getVoltage_mV()
| uint16_t BatteryMonitor::getVoltage_mV |
( |
| ) |
|
Function allows for the user to retrieve the voltage of the battery.
- Parameters
-
- Returns
- uint16_t
◆ isLow()
| bool BatteryMonitor::isLow |
( |
| ) |
|
◆ readVoltageRaw_mV()
| uint16_t BatteryMonitor::readVoltageRaw_mV |
( |
| ) |
|
|
private |
Function calculates the voltage in mV by reading the ADC and applying the conversion to step up to the appropriate input voltage.
- Returns
- uint16_t
◆ hadc
| ADC_HandleTypeDef* BatteryMonitor::hadc |
|
private |
Private Variable hadc Assigns the hadc ADC typedef fromt he STM32 HAL Definition
◆ threshold_mV
| uint16_t BatteryMonitor::threshold_mV |
|
private |
Private Variable threshold_mV Assigns the threshold voltage to indicate low voltage
The documentation for this class was generated from the following files: