VEX LCD Pre-Autonomous Mode Chooser


My team has been discussing multiple autonomous modes for our robot this year. We would like to incorporate the LCD screen into our bot. I have gotten familiarized with how the LCD works, but within the competition I would need to have the LCD loop run in a pre-autonomous mode. I know there is a variable that I can put into a while loop to look like so:

while(<variable> == true){
   do lcd code

By any chance can I get the name of the variable used?

Thank you!

Are you trying to find a way to use the LCD buttons?
For coding the buttons, you’d use nLCDButtons ==
The value is that 1 is the left button, 2 is the middle button, and 4 is the right button. If you want multiple to be added up, for example, both left and middle, you’d add 2 +1 and you have nLCDButtons == 3.

If you want just a normal while loop, just put


There are a number of ways to run LCD menus. Check out what jpearman posted on this:

Here’s another, the code is intermediate level but it’s still worth reading.

Thanks, I was looking for the vrDisabled variable. I have the autonomous chooser all ready, with the button configuration, I just needed to ensure that it would only run in pre autonomous mode, when the bot is disabled.

Hopefully you read the whole thread, vrDisabled is the wrong variable (actually it’s a constant that’s used with a different function, it will always be 0x80)

the correct flag is bIfiRobotDisabled.

I would recommend adding a additional While loop over your LCD selection. We use the addition loop as a “Ready to Go” selection. Basically, at the end of the selection the lcd asks “Are You Ready?” The left button says yes and the right no and the middle does nothing. This is because the middle is what we use to select every other options in our LCD Selection. Basically, if you answer No then the LCD selection starts from the beginning again and if Yes then it ends the While Loop. It’s basically a safe guard if you select the wrong autonomous on accident and saves you from having to restart the robot to re pick the correct one. Just a friendly recommendation :slight_smile:

I have tried using this one, but whenever I would run it, it wouldn’t run. This might be because I’m testing it with the software controller(Debugger Windows > Competition Control), so I will try it on the field controller we have and get back to you.

Thank you for the recommendation. I think this is actually a good choice since the buttons on our LCD can sometimes skip, and choose a different mode.