Displaying power expander battery voltage onto LCD (easyc)

Hello there,

So I have looked on other posts to see how to get the power expander battery to show on the LCD.

I have noticed that I will need to get a variable which can be found on the wiki page, however I was unable to find it…

I assume that the process of displaying the battery voltage would be the same as it was for the main battery and backup battery instead the variable would be changed…


Is the variable simple?

To display the power expander battery voltage you need to connect the power expander to the cortex using a cable from its status port to an analog input. The number read from the analog input is proportional to the battery voltage, it is multiplied by a scale factor to convert into mV or Volts. There are two versions of the power expander and this conversion factor is different depending on which model you have. The Wiki page for the power expander is here, it explains some of this.


There’s more info available in this post

and also this one

but both of these are three years old, things change over time and I cannot verify the numbers in these are still valid, they should be but double check.

Do you have an example of the variable in easyC ?