Calculator Community > HP Calculators

Is it possible to programmatically get the HP Prime's battery level or voltage?

<< < (2/2)

timwessman:
The charging part does have to have tight control over how much current to be drawing internally, however that does not necessarily mean that information is exposed outside the charge controller in a more granular way.

webmasterpdx:
I wrote a program that gets it from the graphical representation on the screen in 25% increments. Here is the source code...


--- Code: ---EXPORT BATVAL() // Battery test
BEGIN
LOCAL x:=315,d:=#D6DEDEh;
CASE
IF GETPIX_P(x,14)==d THEN RETURN 0; END;
IF GETPIX_P(x,11)==d THEN RETURN 25; END;
IF GETPIX_P(x,8)==d THEN RETURN 50; END;
IF GETPIX_P(x,6)==d THEN RETURN 75; END;
DEFAULT RETURN 100;
END; // CASE...
END; // BEGIN

--- End code ---

Navigation

[0] Message Index

[*] Previous page

Go to full version