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

Function getBattery

boards/m5stack-dinmeter/interface.cpp:40–43  ·  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

38** Description: Delivers the battery value from 1-100
39***************************************************************************************/
40int getBattery() {
41 int level = M5.Power.getBatteryLevel();
42 return (level < 0) ? 0 : (level >= 100) ? 100 : level;
43}
44
45/*********************************************************************
46** Function: InputHandler

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected