I have a way to measure battery power
06-25-2017, 05:03 AM
Post: #1
 webmasterpdx Senior Member Posts: 541 Joined: Sep 2015
I have a way to measure battery power
I've seen many posts where people are trying to find the amount of charge in the battery.
I've also seen replies from people working at HP that said it isn't measured very accurately, which sounds right. I've worked with charging chips like these in the past and they often just give a low resolution value (usually in coulombs). Anyhow, regardless of how they measure it, it's displayed in the battery status in the upper RHS of the display.
The rectangle inside the battery icon is 3 pixels wide and 11 pixels high. The exact coordinates to draw a RECT inside the battery icon are 314,4,316,14.
So, all you'd have to do is examine the column of pixels at x = 315. Begin getting the color of the pixels at y = 14, 13, ....4 and if all black it's empty, if all green, it's full, and in between, just find where the color changes and it'll give you the percentage full that the battery is.
It could be that the first pixel just tells you it's not going to shut down yet, and if so, then 2 pixels would mean 10% full, 3 pixels 20% and so on until 11 pixels 100%.
Maybe someone at HP could look at the source code and tell us....
Enjoy...
:-)
 « Next Oldest | Next Newest »

 Messages In This Thread I have a way to measure battery power - webmasterpdx - 06-25-2017 05:03 AM RE: I have a way to measure battery power - cyrille de brĂ©bisson - 06-26-2017, 05:30 AM RE: I have a way to measure battery power - webmasterpdx - 06-27-2017, 10:43 AM RE: I have a way to measure battery power - toml_12953 - 06-28-2017, 12:05 PM RE: I have a way to measure battery power - Tim Wessman - 06-28-2017, 02:59 PM RE: I have a way to measure battery power - toml_12953 - 06-28-2017, 05:38 PM RE: I have a way to measure battery power - DrD - 06-27-2017, 11:21 AM RE: I have a way to measure battery power - TravisE - 06-27-2017, 09:13 PM RE: I have a way to measure battery power - webmasterpdx - 06-28-2017, 01:14 AM RE: I have a way to measure battery power - DrD - 06-28-2017, 10:50 AM RE: I have a way to measure battery power - webmasterpdx - 06-28-2017, 11:02 AM RE: I have a way to measure battery power - DrD - 06-28-2017, 11:20 AM RE: I have a way to measure battery power - webmasterpdx - 06-28-2017, 01:28 PM RE: I have a way to measure battery power - webmasterpdx - 06-28-2017, 01:25 PM RE: I have a way to measure battery power - StephenG1CMZ - 06-28-2017, 04:45 PM RE: I have a way to measure battery power - StephenG1CMZ - 10-28-2017, 02:57 PM RE: I have a way to measure battery power - webmasterpdx - 06-29-2017, 01:54 AM RE: I have a way to measure battery power - toml_12953 - 06-29-2017, 02:46 AM RE: I have a way to measure battery power - StephenG1CMZ - 06-29-2017, 05:35 AM RE: I have a way to measure battery power - webmasterpdx - 06-29-2017, 06:34 AM RE: I have a way to measure battery power - webmasterpdx - 07-01-2017, 09:03 AM RE: I have a way to measure battery power - Dieter - 07-01-2017, 09:57 AM RE: I have a way to measure battery power - webmasterpdx - 07-01-2017, 10:37 AM RE: I have a way to measure battery power - webmasterpdx - 07-01-2017, 06:37 PM RE: I have a way to measure battery power - webmasterpdx - 07-01-2017, 07:13 PM

User(s) browsing this thread: 1 Guest(s)