View unanswered posts | View active topics It is currently Fri Nov 28, 2014 5:10 pm






Reply to topic  [ 5 posts ] 
how to display stuff on the vex lcd display? 
Author Message
Rookie

Joined: Wed Dec 21, 2011 4:22 pm
Posts: 26
Post 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);
}
}


Tue Oct 09, 2012 6:50 pm
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 610
Post 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.

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our Wiki and our Forums.

I just met you,
And this is crazy,
But here's my code now,
So fix it, maybe?
~ Carly Rae Jepsen parody


Wed Oct 10, 2012 4:34 pm
Profile
Rookie

Joined: Wed Dec 21, 2011 4:22 pm
Posts: 26
Post 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?


Wed Oct 10, 2012 4:48 pm
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 610
Post 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

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our Wiki and our Forums.

I just met you,
And this is crazy,
But here's my code now,
So fix it, maybe?
~ Carly Rae Jepsen parody


Thu Oct 11, 2012 4:49 pm
Profile
Rookie

Joined: Wed Dec 21, 2011 4:22 pm
Posts: 26
Post Re: how to display stuff on the vex lcd display?
I using the 3 wire motor cable splitter. That's probably the problem.


Thu Oct 11, 2012 7:10 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.