MCPcopy Create free account
hub / github.com/bmorcelli/Launcher / getBattery

Function getBattery

boards/m5stack-core/interface.cpp:21–25  ·  view source on GitHub ↗

** Function name: getBattery() ** location: display.cpp ** Description: Delivers the battery value from 1-100 ***************************************************************************************/

Source from the content-addressed store, hash-verified

19** Description: Delivers the battery value from 1-100
20***************************************************************************************/
21int getBattery() {
22 uint8_t percent = 0;
23 percent = M5.Power.getBatteryLevel();
24 return (percent < 0) ? 0 : (percent >= 100) ? 100 : percent;
25}
26
27/*********************************************************************
28** Function: setBrightness

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected