The Following User Says Thank You to dr_frost_dk For This Useful Post: | ||
![]() |
2011-01-14
, 10:06
|
|
Posts: 1,503 |
Thanked: 2,688 times |
Joined on Oct 2010
@ Denmark
|
#162
|
The Following User Says Thank You to dr_frost_dk For This Useful Post: | ||
![]() |
2011-01-15
, 19:18
|
Posts: 7 |
Thanked: 6 times |
Joined on Apr 2010
@ outOnTheFields
|
#163
|
--------------------------- Battery Meter --------------------
Heres the Beecon buffer import file and the CODE
...Code:x=$(hal-device | grep voltage.current | awk '{printf "%4.0f",$3}') if [ $x -ge 4050 ];then echo $x | awk '{printf "%1.3fV - %3.1f", $1 / 1000, 85 + ($1 - 4050) / 12}{print "%"}' exit 0;fi if [ $x -ge 3900 -a $x -lt 4050 ];then echo $x | awk '{printf "%1.3fV - %3.1f", $1 / 1000, 70 + ($1 - 3900) / 10}{print "%"}' exit 0;fi if [ $x -ge 3800 -a $x -lt 3900 ];then echo $x | awk '{printf "%1.3fV - %3.1f", $1 / 1000, 50 + ($1 - 3800) / 5}{print "%"}' exit 0;fi if [ $x -ge 3660 -a $x -lt 3800 ];then echo $x | awk '{printf "%1.3fV - %3.1f", $1 / 1000, 15 + ($1 - 3660) / 4}{print "%"}' exit 1;fi if [ $x -ge 3600 -a $x -lt 3660 ];then echo $x | awk '{printf "%1.3fV - %3.1f", $1 / 1000, 5 + ($1 - 3600) / 6}{print "%"}' exit 2;fi if [ $x -lt 3600 ];then echo $x | awk '{printf "%1.3fV - %3.1f", $1 / 1000, ($1 - 3300) / 60}{print "%"}' exit 3;fi
battery.voltage.current = 4 (0x4) (int) battery.voltage.current = 4011 (0xfab) (int)
grep battery.voltage
grep -E 'voltage.current.+[[:digit:]]{4}'
The Following User Says Thank You to miskooldfield For This Useful Post: | ||
![]() |
2011-01-15
, 21:09
|
|
Posts: 1,503 |
Thanked: 2,688 times |
Joined on Oct 2010
@ Denmark
|
#164
|
The Following User Says Thank You to dr_frost_dk For This Useful Post: | ||
![]() |
2011-01-15
, 21:42
|
Posts: 7 |
Thanked: 6 times |
Joined on Apr 2010
@ outOnTheFields
|
#165
|
The Following User Says Thank You to miskooldfield For This Useful Post: | ||
![]() |
2011-01-15
, 21:54
|
|
Posts: 1,503 |
Thanked: 2,688 times |
Joined on Oct 2010
@ Denmark
|
#166
|
The Following User Says Thank You to dr_frost_dk For This Useful Post: | ||
![]() |
2011-01-18
, 17:05
|
Posts: 7 |
Thanked: 6 times |
Joined on Apr 2010
@ outOnTheFields
|
#167
|
The Following User Says Thank You to miskooldfield For This Useful Post: | ||
![]() |
2011-01-18
, 17:21
|
Posts: 1,341 |
Thanked: 708 times |
Joined on Feb 2010
|
#168
|
The Following User Says Thank You to zimon For This Useful Post: | ||
![]() |
2011-01-18
, 17:40
|
|
Posts: 675 |
Thanked: 923 times |
Joined on Apr 2010
@ London
|
#169
|
The Following User Says Thank You to D4rKlar For This Useful Post: | ||
![]() |
2011-01-18
, 18:17
|
Posts: 7 |
Thanked: 6 times |
Joined on Apr 2010
@ outOnTheFields
|
#170
|
nano /home/user/MyDocs/tmp/batteryCheck.sh
x=$(hal-device | grep -E 'voltage.current.+[[:digit:]]{4}' | awk '{printf "%4.0f",$3}')
if [ $x -ge 4050 ];then
echo $x | awk '{printf "%1.3fV - %3.1f", $1 / 1000, 85 + ($1 - 4050) / 12}{print "%"}'
exit 0;fi
if [ $x -ge 3900 -a $x -lt 4050 ];then
echo $x | awk '{printf "%1.3fV - %3.1f", $1 / 1000, 70 + ($1 - 3900) / 10}{print "%"}'
exit 0;fi
if [ $x -ge 3800 -a $x -lt 3900 ];then
echo $x | awk '{printf "%1.3fV - %3.1f", $1 / 1000, 50 + ($1 - 3800) / 5}{print "%"}'
exit 0;fi
if [ $x -ge 3660 -a $x -lt 3800 ];then
echo $x | awk '{printf "%1.3fV - %3.1f", $1 / 1000, 15 + ($1 - 3660) / 4}{print "%"}'
exit 1;fi
if [ $x -ge 3600 -a $x -lt 3660 ];then
echo $x | awk '{printf "%1.3fV - %3.1f", $1 / 1000, 5 + ($1 - 3600) / 6}{print "%"}'
exit 2;fi
if [ $x -lt 3600 ];then
echo $x | awk '{printf "%1.3fV - %3.1f", $1 / 1000, ($1 - 3300) / 60}{print "%"}'
exit 3;fi
chmod +x /home/user/MyDocs/tmp/batteryCheck.sh
sh /home/user/MyDocs/tmp/batteryCheck.sh
cp /home/user/MyDocs/tmp/batteryCheck.sh /usr/bin/
batteryCheck
x=$(hal-device | grep -E 'voltage.current.+[[:digit:]]{4}' | awk '{printf "%4.0f",$3}')
if [ $x -ge 4050 ];then
echo $x | awk '{printf "%3.1f", $1 / 1000, 85 + ($1 - 4050) / 12}{print "%"}'
exit 0;fi
if [ $x -ge 3900 -a $x -lt 4050 ];then
echo $x | awk '{printf "%3.1f", $1 / 1000, 70 + ($1 - 3900) / 10}{print "%"}'
exit 0;fi
if [ $x -ge 3800 -a $x -lt 3900 ];then
echo $x | awk '{printf "%3.1f", $1 / 1000, 50 + ($1 - 3800) / 5}{print "%"}'
exit 0;fi
if [ $x -ge 3660 -a $x -lt 3800 ];then
echo $x | awk '{printf "%3.1f", $1 / 1000, 15 + ($1 - 3660) / 4}{print "%"}'
exit 1;fi
if [ $x -ge 3600 -a $x -lt 3660 ];then
echo $x | awk '{printf "%3.1f", $1 / 1000, 5 + ($1 - 3600) / 6}{print "%"}'
exit 2;fi
if [ $x -lt 3600 ];then
echo $x | awk '{printf "%3.1f", $1 / 1000, ($1 - 3300) / 60}{print "%"}'
exit 3;fi
![]() |
Tags |
battery, battery test, best battery, good bad ugly, modding, mugen battery, scud battery, tool got banned, yasirrfc |
|
still only precise to 2%
but now with background color to give a more visual battery left status / holy crap i better charge it.....
It is at Page #1, Post #3
N900 @ 850MHz (LV) & 3044mAh Battery
Battery Tests and Battery Mod / Homemade 3000mAh XL Battery - (DONATE)
Custom Brightness & No Light Sensor
N900 DIY Micro Amplifier, turn your N900 into a home stereo
Fix you USB before and after it breaks
Feel free to contact me through PM, Skype or G.Talk