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

Function getBattery

boards/m5stack-core2/interface.cpp:20–24  ·  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

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected