Post Reply 
I have a way to measure battery power
06-25-2017, 05:03 AM
Post: #1
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....
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
I have a way to measure battery power - webmasterpdx - 06-25-2017 05:03 AM

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