Differences
This shows you the differences between two versions of the page.
Next revision Both sides next revision | |||
en:c0_read_battery_voltage [2016/04/04 17:43] ruppi created |
en:c0_read_battery_voltage [2016/04/04 17:50] ruppi |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ==== Read Battery Voltage Script ==== | ||
+ | This script read the voltage of battery.\\ | ||
+ | Save the following code as readbatvol.sh in home directory.\\ | ||
- | + | <code> | |
#!/bin/sh | #!/bin/sh | ||
+ | # | ||
# Read Battery voltage on ODROID-C0 | # Read Battery voltage on ODROID-C0 | ||
# | # | ||
Line 10: | Line 13: | ||
BATTVOL=$(echo $ADCRES*$ADCVAL | bc) | BATTVOL=$(echo $ADCRES*$ADCVAL | bc) | ||
echo Battery voltage is $BATTVOL V | echo Battery voltage is $BATTVOL V | ||
+ | </code> | ||
+ | |||
+ | Please change the script permissions to execute with chmod | ||
+ | <code> | ||
+ | sudo chmod a+x readbatvol.sh | ||
+ | </code> |