Created
September 14, 2010 00:41
-
-
Save felipec/578337 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
RS=20 | |
get_capacity() | |
{ | |
c=`i2cget -y 2 0x55 0x0c w` | |
return $(($c * 3570 / $RS / 1000)) | |
} | |
sleep 10 | |
while true | |
do | |
get_capacity | |
echo `date +'%u %T'` "${?}mAh" | |
sleep 600 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment