Skip to content

Instantly share code, notes, and snippets.

@felipec
Created September 14, 2010 00:41
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felipec/578337 to your computer and use it in GitHub Desktop.
Save felipec/578337 to your computer and use it in GitHub Desktop.
#!/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