Question about LCD Display in RobotC.

How would you set up your motors and sensors setup with an LCD display? I am new to using the LCD display and know next to nothing about them, if there are any tips you could give me that would be great!! What I am planning on starting with is using the LCD to display my four different autonomous selections, and my battery life percentages. Thanks in advance.

Here is a snippet of code that will display two encoder values, one on each line. (EDIT: Of course, you need to have your sensors set up earlier in the code with whatever names you want to give them. In this example, the encoders are named LeftEncoderA and RightEncoderA.)

It’s possible to create a menu selection for your autonomous, and have that display, too.

Does this help?

	// Turn on LCD Backlight...
	bLCDBacklight = true;

	while (true)	//Creates an infinite loop
		//LCD display of both encoder values...
		//To view these outputs on the laptop via ROBOTC, go to ROBOT>>Debug Windows>>Vex Remote Screen.
		clearLCDLine(0);            // clear the top VEX LCD line.
		clearLCDLine(1);          // clear the bottom VEX LCD line.
		setLCDPosition(0,0);    // set the VEX LCD cursor the first line, first space.
		displayNextLCDString("L: ");  // display Left Encoder on the top line.
		displayNextLCDNumber(SensorValue(LeftEncoderA));    // display the reading.

		setLCDPosition(1,0); // set the VEX LCD cursor the second line, first space.
		displayNextLCDString("R: ");            // display Right Encoder on the second line.
		displayNextLCDNumber(SensorValue(RightEncoderA));    // display the reading.


You might also have a look at this:

There’s lots of example code for the LCD on the forum.

Here was my attempt at providing a series of examples with increasing difficulty for autonomous selection.

ROBOTC LCD autonomous selection

Thank you.

Can someone show me an example of how to set up the motors and sensors setup when using the LCD?