LCD Display not working

Hello,
I just wired up my VEX LCD to an ARM cortex mircocontroller using a serial Y-Cable (276-1579) but the basic “Hello World” program using RobotC doesnt work. All that the LCD shows is

BUT 0 0 0
BUT 0 0 0
I tried connecting it to UART1 and I2C ports on the cortex but it doesnt work. This is the basic code snippet:

task main()
{
displayLCDCenteredString(0, “Hello World!”);
wait1Msec(10000);
}
Can someone please tell me what I am missing out on? My competition is on Friday and I need to set this up somehow!

The LCD is connected into the UART2 port by default. It is the four wire port in between UART1 and I2C.
The code you have should work fine.
It is possible to set the LCD up in port 1 too (allowing you to run 2 LCD displays). There is info on that (from jpearman) if you are interested.

Thank you so much. I did try UART2 and it displayed a blank screen.
Are there any LCD library file/s that I need to attach to my code as the RobotC software didn’t show any of the LCD inbuilt functions on the left panel. But the LCD functions like displayLCDCenteredString was highlighted in my code.

Thank you so much again!

Is the LCD configured in the motor sensor setup correctly? Post all the code from the file including #pragma.

Also open up the debugger for the LCD. Remember to press start after downloading.

Hello,
I am really sorry for the delay. I didn’t find any appropriate option to configure the LCD in the motor sensor setup window. Could you please guide me through this?

And here is the full code, it has 3 tasks ( 2 autonomous and 1 remote controlled). The first autonomous task sees the usage of ultrasonic range finder to identify ping pong balls. The 2nd autonomous task is a simple line follower code. The driver challenge task has a small code to count the number of Ping Pong balls that the clawbot picks up. It uses a limit switch to sense the picking up of balls.

#pragma config(Sensor, in1, RightSensor, sensorReflection)
#pragma config(Sensor, in2, CenterSensor, sensorReflection)
#pragma config(Sensor, in3, LeftSensor, sensorReflection)
#pragma config(Sensor, dgtl4, LimitSwitch, sensorTouch)
#pragma config(Sensor, dgtl5, LeftEncoder, sensorQuadEncoder)
#pragma config(Sensor, dgtl7, RightEncoder, sensorQuadEncoder)
#pragma config(Sensor, dgtl10, sonarSensor, sensorSONAR_inch)
#pragma config(Motor, port1, RightMotor, tmotorVex393_HBridge, openLoop)
#pragma config(Motor, port2, ArmMotor, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port3, ClawMotor, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port10, LeftMotor, tmotorVex393_HBridge, openLoop)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//

//const short LeftButton=1;
//const short CenterButton=2;
//const short RightButton=4;
int pressed=0;

void Not_Pressed_Yet()
{
while (nLCDButtons==0) {
wait1Msec(5);
}
}

void Not_Released_Yet()
{
while (nLCDButtons!=0) {
wait1Msec(5);
}
}

void pressed_button()
{
while (Sensorvalue[dgtl4]==1)
{
pressed=1
}
wait1Msec(5);
}

void released_button()
{
while (SensorValue[LimitSwitch]==0)
{
pressed=0;
}
wait1Msec(5);
}

void Straight()
{
if (SensorValue[LeftEncoder] > SensorValue[RightEncoder])
{
motor[port1]=50;
motor[port10]=63;
}
if (SensorValue[LeftEncoder] < SensorValue[RightEncoder])
{
motor[port1]=63;
motor[port10]=50;
}
if (SensorValue[LeftEncoder]==SensorValue[RightEncoder])
{
motor[port1]=63;
motor[port10]=63;
}
}
void TurnLeft()
{ motor[port1] = 0;
motor[port10] = 50;
}

void TurnRight()
{
motor[port1] = 50;
motor[port10] = 0;
}

void PowerRight()
{
motor[port1]=-50;
motor[port10]=50;
}

void PowerLeft()
{
motor[port1]=50;
motor[port10]=-50;
}

task autonomous_1()
{
wait1Msec(2000);
//bMotorReflected[port2]=1;

SensorValue[LeftEncoder]=0;
SensorValue[RightEncoder]=0;

motor[ArmMotor]=63;
while (SensorValue[sonarSensor]>=2) // The distance till which the robot moves straight
{
Straight();
}
while (SensorValue[sonarSensor]<=1)
{
motor[ClawMotor]=50;
} //Ultrasonic Range Finder code
}

task autonomous_2()
{
while(SensorValue[in2] > 2250) // Center sensor sees black
{

	Straight(); // Goes forward
	if(SensorValue[in1] > 2300) // Right sensor sees black
	{
		TurnLeft(); // Turns left
	}
	if(SensorValue[in3] > 2300) // Left sensor sees black
	{
		TurnRight(); // Turns right
	}

}	                                                         // Sensor challenge code

}

task driver_challenge ()
{
int ball_counter=0;
int pressed=0;
while (true) {
clearLCDLine(0);
clearLCDLine(1);

displayNextLCDString("Count:  ")
displayNextLCDNumber(ball_counter)  //check what the 4 is for

 pressed_button();

   if(sensorvalue[dgtl4]==1){

   released_button();
   ball_counter++;
 }

}
}

task main()
{
int count=0;
clearLCDLine(0);
clearLCDLine(1);
Not_Pressed_Yet();
while (1==1)
if (nLCDButtons==1)
{
Not_Released_Yet();
count=1;
starttask (autonomous_1); // check if you need to call the function here! (20 secs auto)
}
else if (nLCDButtons==4)
{
Not_Released_Yet();
count=2;
starttask (autonomous_2); // Sensor challenge round
}
else if (nLCDButtons==2)
{
Not_Released_Yet();
count=3;
starttask (driver_challenge); // Driver challenge round
}
}

Thank you so much in advance!

You should check every tab looking for UART 2. You may have to change your menu level to super user.

Hi Tabor,
The LCD worked when I switched to super user and gave the necessary UART settings!

Thank you so much!:slight_smile: