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

Function getBattery

boards/smoochiee-board/interface.cpp:58–63  ·  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

56** Description: Delivers the battery value from 1-100+
57***************************************************************************************/
58int getBattery() {
59 uint8_t percent = 0;
60 percent = (PPM.getSystemVoltage() - 3300) * 100 / (float)(4150 - 3350);
61
62 return (percent < 0) ? 0 : (percent >= 100) ? 100 : percent;
63}
64
65/*********************************************************************
66** Function: setBrightness

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected