| Reply | « Previous Thread | Next Thread » |
|
I am trying to test a program using the battery level function. I have to do something if the battery level change, then I have to be checking the battery level.
I start the program with a while structure and I can't to detect when the sysinfo.battery() changes by 1 unit (of 100 units). Suddenly the change is by example from 100 to 85 or from 71 to 57 and the program stop. The code looks like: import sysinfo batteryLevel= sysinfo.battery() while batteryLevel > 97: ....... if sysinfo.battery() < batteryLevel: batteryLevel = sysinfo.battery() print batteryLevel doSomething() ............... Why it is happening? or what can I do to know when the battery level change in one unit? Thanks for your help. PS: The code have tabs but in the message are not published. |
|
Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
Offline
Forum Nokia Champion
|
|
Hi,
I don't think that's possible. See 100 (the battery level for full) divided by 7 (the number of bars of the battery indicator) is 14.285. Python probably rounds it off to 14 or 15. 100-15 is 85, 85-14 is 71 etc. The point is that using sysinfo you can only display the battery level on a 0-7 scale rather than a 0-100 scale. But this is just a guess. I may be wrong. PS. When posting code, use the code tags (the # button that you see in the buttons area when making a post). That keeps indentation. |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Problem with eglSwapBuffers and heap corruption | greatape | Symbian Media (Graphics & Sounds) | 2 | 2007-05-24 04:35 |
| netcards - Problem with opening adapter | kernj | Symbian Tools & SDKs | 5 | 2007-01-10 09:56 |
| WAP service problem on Apache | bigg_o | Browsing and Mark-ups | 3 | 2005-04-17 17:05 |
| Problem: S60 SDK for CW in PC with .NET | anttij | Carbide.c++ IDE and plug-ins | 1 | 2005-02-28 12:36 |
| wireless problem | sash_mca | General Browsing | 0 | 2003-06-06 12:34 |