VEX LCD

What is the VEX LCD, and why should I use it?
The VEX LCD is a two line text screen that can display 16 characters per line.  It also has three buttons for user input.  The LCD connects to one of the Cortex Microcontroller’s I2C ports using a Serial Y-Cable.
I have found the LCD to be exceedingly valuable in VRC.  It allows the robot to give feedback to the operator, informing the drivers of a low battery, of current sensor readings, or the currently selected autonomous program.

Ideas for use:

  • Display Battery Voltage: I like to use the LCD to display the battery voltage before the match begins.  To do this in ROBOTC, use the “nAvgBatteryLevel” variable to access the current battery voltage (in millivolts), and display it using the command “displayNextLCDNumber(nAvgBatteryLevel);”  These commands should be done in the “pre_auton()” subroutine.
  • Select Autonomous Program: This topic is a little more complex and probably deserves its own post. However, I will cover the basic idea here.  In the pre-autonomous function monitor the LCD buttons in a loop.  If the left button is pressed, decrement a counter; if the right button is pressed, increment the counter.  When the counter is changed, display the current counter value (or a bit of text dependent on the counter value).  Exit the loop when the center button is pressed.  Now you can use the counter to select the correct autonomous routine.  Again – this probably deserves its own post…
  • Display sensor readings: For example, if you want to see the current light sensor reading when calibrating your light sensors before the match, you can send the current reading to the LCD.  This is also helpful for arm potentiometer if presets stop acting as expected.
    Posted in Robot Programming, ROBOTC, Tutorial, VEX

    Twitter