Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:c0_read_battery_voltage [2016/04/04 17:50] ruppi |
en:c0_read_battery_voltage [2016/04/04 18:03] (current) ruppi |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ==== Read Battery Voltage Script ==== | + | ==== Read Battery Voltage Script on ODROID-C0 ==== |
- | This script read the voltage of battery.\\ | + | This script read the voltage of battery from ADC channel 0.\\ |
Save the following code as readbatvol.sh in home directory.\\ | Save the following code as readbatvol.sh in home directory.\\ | ||
Line 6: | Line 6: | ||
#!/bin/sh | #!/bin/sh | ||
# | # | ||
- | # Read Battery voltage on ODROID-C0 | + | # Read Battery Voltage on ODROID-C0 |
# | # | ||
Line 15: | Line 15: | ||
</code> | </code> | ||
- | Please change the script permissions to execute with chmod | + | Please change the script permissions to execute with chmod. |
<code> | <code> | ||
sudo chmod a+x readbatvol.sh | sudo chmod a+x readbatvol.sh | ||
</code> | </code> | ||
+ | |||
+ | Execute the script to read battery voltage. | ||
+ | |||
+ | <code> | ||
+ | ./readbatvol.sh | ||
+ | </code> | ||
+ |