This is an old revision of the document!
Read Battery Voltage Script
This script read the voltage of battery.
Save the following code as readbatvol.sh in home directory.
#!/bin/sh # # Read Battery voltage on ODROID-C0 # ADCRES=0.004106 ADCVAL=$(cat /sys/class/saradc/saradc_ch0) BATTVOL=$(echo $ADCRES*$ADCVAL | bc) echo Battery voltage is $BATTVOL V
Please change the script permissions to execute with chmod
sudo chmod a+x readbatvol.sh