Hello,
We have been having trouble getting our power expander battery voltage to display on the LCD display along with the main battery voltage. The main voltage displays accurately, but the readout for the expander/secondary battery is always zero volts. The multiplier is one that I found in a previous discussion, so I am not sure if this is the correct calculation. Any input would be greatly appreciated, thanks!
task LCD()
{
clearLCDLine(1);
clearLCDLine(0);
while(true)
{
bLCDBacklight = true;
displayLCDString(1,1, "Battery:" ) ;
sprintf(mainBattery, "%1.2f%c", nImmediateBatteryLevel/1000.0,'V');
displayNextLCDString( mainBattery);
displayLCDString(0,0, "Secondary:" ) ;
sprintf(backupBattery, "%1.2f%c", (((float)SensorValue[in1] * 5.48 / 184.7)), 'V');
displayNextLCDString( backupBattery);
}
}
If you look in the sensor debug window, are you getting a reasonable value for analog 1?
I’m not sure where you got the divisor from, the VEX Wiki lists the divisors depending on PE version (Step 6):
http://www.vexrobotics.com/wiki/Power_Expander#Installation_Instructions
There is also some information that may be relevant in this thread:
https://vexforum.com/t/robotc-power-expander-status-battery-voltage/21280/1
Thanks, at our next meeting I’ll check the debugger and change the multiplier out and see if that was the problem
RLA111
October 10, 2015, 7:25pm
4
Just ask mateo. I think we have this already in our code.
Below is the program calculation that we ran last year.
sprintf (powerexpander, "%1.2f%c",sensorvalue[Status] /4/45.6, 'v';
displayLCDString(1, 0, "Expander: ");
displayNextLCDString(powerexpander);
Ok thanks sounds good I’ll ask him on Tuesday