I have a way to measure battery power
07-01-2017, 09:57 AM (This post was last modified: 07-01-2017 10:07 AM by Dieter.)
Post: #21
 Dieter Senior Member Posts: 2,397 Joined: Dec 2013
RE: I have a way to measure battery power
(07-01-2017 09:03 AM)webmasterpdx Wrote:
Code:
V   Y  Pixels  HP   C 100 04 11     100 #008400h Bright Green  80 06 09      75 #008400h Bright Green  60 08 07      50 #008400h Bright Green  30 11 05      25 #EFCE29h Yellow

If you want to return the "official" HP percentage values, why don't you simply calculate V accordingly?

V = 25 * int(6 – 0,4*Y)

Or, if the last value in the "pixels" column really is 5 and not 4:

V = 25 * int(0,38*pixels)
(If it's actually 4 pixels instead of 5, replace 0,38 with 0,4)

Edit: I see you just edited your post and changed the values in the V and "Pixels" column.
With the new values it's now...

V = 25 * int(6 – 0,4*Y)
resp.
V = 25 * int(0,4*pixels)

(07-01-2017 09:03 AM)webmasterpdx Wrote:  Ignore the word Code: above....I didn't know how to format the table.

Code boxes are fine. You can avoid the first blank line by beginning directly (!) after the "code" tag, i.e. not one line below.

Dieter
07-01-2017, 10:37 AM (This post was last modified: 07-01-2017 10:40 AM by webmasterpdx.)
Post: #22
 webmasterpdx Senior Member Posts: 541 Joined: Sep 2015
RE: I have a way to measure battery power
I edited that post several times as I got some of the values wrong and I was trying to figure out how to format it....
Like I said before..no point in commenting on the code of my routine as it's just a rough test thingy I whipped out while I wait until the power goes down.....i'll rewrite it completely when i get all the info I need and the power switches it off.
07-01-2017, 06:37 PM
Post: #23
 webmasterpdx Senior Member Posts: 541 Joined: Sep 2015
RE: I have a way to measure battery power
Here is the latest table of results down to shutdown....

Code:
V   Y  Pixels  HP   C 100 04 11     100 #008400h Bright Green  80 07 08      75 #008400h Bright Green  60 09 06      50 #008400h Bright Green  30 12 03      25 #EFCE29h Yellow  00 15 00      00 #D6DEDE White

I have new code....I'm charging up my battery to test it now, and then I'll post it.
It'll give results from the HP column.
Note that it stays at 0 for a while before giving a popup message: Critical Low Battery...
There is another low battery message too, depending on what you are doing when it kicks in. However, the battery stays at zero for a little bit before popping up the messages.
Then, after a little bit, the power cuts off on it's own.
07-01-2017, 07:13 PM
Post: #24
 webmasterpdx Senior Member Posts: 541 Joined: Sep 2015
RE: I have a way to measure battery power
Latest results with new code is now moved to here...
10-28-2017, 02:57 PM
Post: #25
 StephenG1CMZ Senior Member Posts: 1,033 Joined: May 2015
RE: I have a way to measure battery power
(06-28-2017 04:45 PM)StephenG1CMZ Wrote:  It seems that on the Android, the HP Prime battery status only updates when the screen is tapped.
Until then, it continues to display the previous status.

So it may not be possible to program a "beep" if the charging lead is accidentally disconnected, or monitor the mains supply.

Detail: plug/unplug the lead - Prime display doesnt change (Android battery status does).
Tap the screen once - display updates charging/discharging status.
Triple-tapping the screen (Android optional accessibility screen zoom): charging status doesnt update.

The no-update affects the charging/discharging indication - I don't know yet whether it also affects the charge percentage.

Android 5.0.2
LG G3 s.

As no one has commented on this, I wonder...
Is this "feature" common on Androids (and perhaps elsewhere), or something unusual about my Android/phone?

Stephen Lewkowicz (G1CMZ)
https://my.numworks.com/python/steveg1cmz
 « Next Oldest | Next Newest »