I am trying to get a nice and “user-friendly” battery level indicator shown for my dog’s tracker in Petovik.
My device does not output battery percentage directly, but does output battery voltage via a parameter called “pwr_int”. I have this currently shown on the main Petovik screen, but would much rather have the actual battery percentage.
The manufacturer says that 4.2V is full charge, 3.3V is empty, and in between there is a linear relationship between battery voltage and % battery remaining, so I can convert battery voltage to % battery remaining via a simple transformation:
<% battery remaining> = ( <battery voltage> - 3.3 ) * 111.111
Is it possible to have Petovik run “pwr_int” parameter through the above equation and display the output instead of displaying the raw battery voltage?