My first day

Peter Rasmussen plr at udgaard.com
Sat Aug 11 20:47:40 CEST 2007


Yes, and it seems that we shouldn't be too worried about jitter in the 
values during charging, or what?

The script:

root at fic-gta01:~$ cat get-batt-value.sh
#!/bin/sh
count=1
while [ "$count" -le "$1" ]
do
printf "%d. " $count
battvolt=$(cat `find /sys | grep battvolt`)
printf "%d\n" $battvolt
sleep 2
let count=count+1
done

Produced:

root at fic-gta01:~$ sh get-batt-value.sh 10
1. 3884
2. 3890
3. 3931
4. 3890
5. 3890
6. 3890
7. 3896
8. 3878
9. 3878
10. 3890

Not so bad I guess, I am not familiar with battery characteristics, but 
a little surprised anyway :-)

Peter

Shakthi Kannan wrote:
> Hi,
>
> On 8/11/07, Joe Pfeiffer <joseph at pfeifferfamily.net> wrote:
>   
>> Why the cat command?  Just
>>
>> find /sys | grep battvolt
>>
>> will do the same thing.
>>     
>
> The above will only display
> /sys/devices/platform/s3c2410-i2c/i2c-0/0-0008/battvolt, and not its
> value. Hence you need to cat it.
>
> SK
>
>   



More information about the device-owners mailing list