System Calls

batteryCharge()

System.batteryCharge, batteryCharge

Since 1.5.0:

Determines the battery state of charge (SoC) as a percentage, as a floating point number.

// PROTOTYPE
float batteryCharge() const

// EXAMPLE
float batterySoc = System.batteryCharge();
Log.info("soc=%.1f", batterySoc);

Note:

Power Management including battery charge is available on the Boron, B Series SoM, Tracker SoM (Gen 3), Electron, and E Series (Gen 2).

It is not available on the Argon (Gen 3), Photon, or P1 (Gen 2).