Full Version: Battery level measurement?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Does the board offer a way to measure the battery's output voltage? It would be good to estimate the remaining battery charge.
You can read battery status running Linux just by reading info from sysfs (/sys/class/....) files. You get current, voltage, remaining percentage (the PMIC has a learning battery gauge) and other things...
I wrote this script a while ago to show the various battery bits... if you ignore the colour bits, it shows the sysfs paths for the different stats you can show. It uses bc (sudo apt-get install bc) to show the battery voltage as a decimal number.