ROBOTC.net forums
http://www.robotc.net/forums/

how to display stuff on the vex lcd display?
http://www.robotc.net/forums/viewtopic.php?f=11&t=4965
Page 1 of 1

Author:  themigthy [ Tue Oct 09, 2012 6:50 pm ]
Post subject:  how to display stuff on the vex lcd display?

I am trying out one of the sample code for the vex lcd display, but when I load the program all i get on the vex lcd display is:
but 0 0 0
but 0 0 0


the lcd display is connected in the correct port, also i am using a vex y-cable to connect the LCD to the cortex. how can i get it working? Is there some steps i need to do?
help! Below is the code I used.

Code:
#pragma config(UART_Usage, UART2, uartVEXLCD, baudRate19200, IOPins, None, None)
//*!!Code automatically generated by 'ROBOTC' configuration wizard                             !!*//
 
/*
Display Battery Voltage
ROBOTC on VEX 2.0 Cortex
This program uses the Display functions of ROBOTC on the VEX 2.0 Cortex platform.
It will display the value of the main battery on line 0 and backup battery on line 1.


Code:
ROBOT CONFIGURATION
MOTORS & SENSORS:
[I/O Port]                    [Name]                            [Type]                                [Description
UART Port 2                    none                                VEX LCD                                VEX LCD Screen
*/
 


Code:
task main()
{
bLCDBacklight = true;                                    // Turn on LCD Backlight
string mainBattery, backupBattery;
 
while(true)                                                        // An infinite loop to keep the program running until you terminate it
{
clearLCDLine(0);                                            // Clear line 1 (0) of the LCD
clearLCDLine(1);                                            // Clear line 2 (1) of the LCD
 
//Display the Primary Robot battery voltage
displayLCDString(0, 0, "Primary: ");
sprintf(mainBattery, "%1.2f%c", nImmediateBatteryLevel/1000.0,'V'); //Build the value to be displayed
displayNextLCDString(mainBattery);
 
//Display the Backup battery voltage
displayLCDString(1, 0, "Backup: ");
sprintf(backupBattery, "%1.2f%c", BackupBatteryLevel/1000.0, 'V');    //Build the value to be displayed
displayNextLCDString(backupBattery);
 
//Short delay for the LCD refresh rate
wait1Msec(100);
}
}

Author:  JohnWatson [ Wed Oct 10, 2012 4:34 pm ]
Post subject:  Re: how to display stuff on the vex lcd display?

This issue normally appears when there is a wiring issue; I tested the code on our testbed and it was able to run it without any problems. Double check to make sure that the LCD screen is plugged into UART2, and that the two wires are plugged into fully to the correct ports (the black-red-yellow wires should be on the left, the black-red-white one on the right). Also, make sure ROBOTC is up-to-date and that you have the latest version of the firmware installed on the Cortex.

Author:  themigthy [ Wed Oct 10, 2012 4:48 pm ]
Post subject:  Re: how to display stuff on the vex lcd display?

Another question do I have you use the y cable to connect the lcd to the cortex? And where in the cortex do I connect the
black-red- white cable?

Author:  JohnWatson [ Thu Oct 11, 2012 4:49 pm ]
Post subject:  Re: how to display stuff on the vex lcd display?

Are you using the 3-wire motor cable splitter (http://www.vexrobotics.com/276-1423.html) or the Serial Y Cable (http://www.vexrobotics.com/276-1579.html)? You can't use the first one with the VEX LCD screen; it is used to drive multiple motors/servos with at the same levels/positions from one port.

The second cable, the Serial Y cable, will allow you to connect to the VEX LCD screen. The 4-prong (Black, Red, Yellow, White) will plug into the UART2 port on the Cortex. The Receive cable (Black, Red, Yellow) goes into the port labeled on the screen as RX. The Transmit cable (Black, Red, White) goes into the port labeled on the screen as TX.

There is a close-up view of the RX/TX ports one VEX's website: http://www.vexrobotics.com/media/catalo ... ottom.jpeg

Author:  themigthy [ Thu Oct 11, 2012 7:10 pm ]
Post subject:  Re: how to display stuff on the vex lcd display?

I using the 3 wire motor cable splitter. That's probably the problem.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/