So in our code, we have an LCD to Select Auto. We often lose connection
(Working on this) an find ourselves panicking because our robot is dead on the field because our LCD decided that we needed to Select an Auto. Again. Is there any way we can resolve this. i.e. putting a function in driver control or something?
Running RobotC v4.06
Selection is made in Pre-Auton
Autonomous Reads LCD Value
Driver Displays Voltage.
I’m 99% sure that your selection/reading LCD input code should be in pre_auton(), not autonomous(). (But, then again, it’s been a while since I’ve written an LCD selector.)
Would it help to place a default selection in your pre-autonomous? The default could be to do nothing during autonomous, and I think that would prevent your code from hanging up while still waiting on the LCD when no LCD is connected.
Look up the 4080A programming help needed thread and you will see where JPearman corrected that code so the lcd only looked for an input when the field controller was set to disabled. That robot had the same issue every match in San Antonio, and never again since. The code below is what was changed. If you post your code you should get some help fixing it.
#include "Vex_Competition_Includes.c" //Main competition background code do not modify!
//Declare count variable to keep track of our choice
int count = 0;
//Wait for Press--------------------------------------------------
void waitForPress()
{
while( (nLCDButtons == 0) && bIfiRobotDisabled )
wait1Msec(5);
}
//----------------------------------------------------------------
//Wait for Release------------------------------------------------
void waitForRelease()
{
while( (nLCDButtons != 0) && bIfiRobotDisabled )
wait1Msec(5);
}
void pre_auton()