On my team’s robot, we are trying to read the voltage of the battery of the power expander. To do that, I have to read the value of status wire that connects to the analog/digital port from the power expander. How would you do that in easy c?
You just read the analong voltage from the power exapander and some math to scale the input upto battery levels. Here is the wiki for the math. If you use their Cortex example you need to use Analog Input High Resolution.
How would you read the analog voltage from the power expander.
Wire it as shown in the Wiki and then Call “Get Analog Input HR”. Then look at the value returned.
I’m waiting to hear back from Vex on the output in relationship to the battery voltage. I’ve been told there are two models of expander and the values are diffrent between them. But, for now if you want to cheat, you could take a battery fully charged and one fully drained, get the two values and decide from there what to do with an IF statement.