#include <battery.h>
◆ Battery()
| Device::Battery::Battery |
( |
Robot & | robot | ) |
|
|
explicit |
◆ ~Battery()
| Device::Battery::~Battery |
( |
| ) |
|
◆ get_millivolts()
| uint16_t Device::Battery::get_millivolts |
( |
| ) |
const |
|
inlinenodiscard |
Returns the current battery voltage.
- Returns
- The voltage in millivolts
◆ get_percentage()
| int8_t Device::Battery::get_percentage |
( |
| ) |
const |
|
inlinenodiscard |
Returns the current battery percentage in percent.
- Note
- The percentage can go negative if the measured voltage drops below 3300 mV
- Returns
- The current percentage from ~0% and up to 100%
◆ initialize()
| void Device::Battery::initialize |
( |
| ) |
|
Configures the needed ADC channel.
◆ update()
| void Device::Battery::update |
( |
| ) |
|
Read and calculate current battery state.
The documentation for this class was generated from the following files: