View Single Post
dr_frost_dk's Avatar
Posts: 1,503 | Thanked: 2,688 times | Joined on Oct 2010 @ Denmark
#1052
kind off, used a more basic code "sh", not so elegant but it gets the job done.

Side Question:
why is the sh in the N900 terminal not "advanced" enough to use
Code:
if [[ $x -ge 3660 && $x -lt 3800 ]];then
as in my new beecon V1.2 i had to use
Code:
if [ $x -ge 3660 ];then if [ $x -lt 3800 ];then
which is kinda stupid double work.... and that's why i used AWK instead, and of course i still use AWK because it is easier to calculate in and can make it look "pretty" with #.### and ###.# like the old qbasic way (print using), sadly that's my only programming language i am a custom to since i started in about 1994, before that C64
Code:
if [ $x -ge 3660 ];then if [ $x -lt 3800 ];then
echo $x | awk '{printf "%1.3fV - %3.1f", $1 / 1000, 15 + ($1 - 3660) / 4}{print "%"}'
exit 1
fi;fi
But the new V1.2 really helps to get a quick overview of the battery level, with the colors
BLUE - (85% - 100%) - Full charge
GREEN - (50% - 85%) - Still good
YELLOW - (15% - 50%) - Getting Low
ORANGE - (5% - 15%) - Start thinking about finding your charger
RED - (0% - 5%) - I told you to find that charger!!!

Next Version maybe with voice control so that it screams at you when it is low

Last edited by dr_frost_dk; 2011-01-13 at 10:40.