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, E404X (Gen 3), Electron, and E-Series (Gen 2).

It is not available on the P2, Photon 2, Argon, Photon, or P1.