Battery level module.
More...
#include <battery.hpp>
|
| enum | Source { None
, Adapter
, Dock
} |
| |
| enum | Level { Dangerous
, Low
, Healthy
, Maximum
} |
| |
| enum | State { Discharging
, Charged
, Charging
} |
| |
|
| | Battery () |
| |
| | Battery (const uint8_t &new_voltage, const uint8_t &charger_flag) |
| |
|
Level | level () const |
| |
|
float | percent () const |
| |
|
|
double | voltage |
| |
|
State | charging_state |
| |
|
Source | charging_source |
| |
|
|
static double | capacity = 16.5 |
| |
|
static double | low = 14.0 |
| |
|
static double | dangerous = 13.2 |
| |
Battery level module.
Currently hard codes the battery status. It might be useful to provide some configurable parameters for this module in the future.
◆ Battery() [1/2]
| kobuki::Battery::Battery |
( |
| ) |
|
|
inline |
◆ Battery() [2/2]
| kobuki::Battery::Battery |
( |
const uint8_t & |
new_voltage, |
|
|
const uint8_t & |
charger_flag |
|
) |
| |
Configures the battery status given the current sensor readings.
- Parameters
-
| new_voltage | : measured voltage*10 |
| charger_flag | : bit flag representing charging status and source |
The documentation for this class was generated from the following files:
- /github/workspace/include/kobuki_core/modules/battery.hpp
- /github/workspace/src/driver/battery.cpp