Lcd

can anyone give me a sample of of the LCD screen when itsbeing used in competition. no matter what i try nothing works:confused::confused::confused:

What have you tried? ROBOTC or EasyC? What do you want to do?

Are you referring to the programming of the LCD Screen or the placement and wiring on the robot?

Make sure your ports are plugged in correctly. Note that the cable with the yellow wire is on the RX (right) port and the white cable is on the TX port (left). See this picture: http://www.robotc.net/blog/wp-content/uploads/2012/05/Battery-Voltage.jpg

And as taken from the Inventor’s Guide for the LCD screen:

Also, make sure your UART numbers match up. If you’re using ROBOTC, you may need to change it from the default.

If neither of those possible solutions fix it, as jpearman said, we need code.

thanksbut the help i need is in programong

easyC or ROBOTC?

Im using RobotC

Have you looked in the sample programs? RobotC has a lot of helpful sample programs.

This is what my LCD is doing for displaying battery voltages.


task Display_LCD(){
  bLCDBacklight = true;
  while(true){
    string regular_bat, expand_bat, backup_bat;
    StringFormat(regular_bat, "%1.2f", (float)nImmediateBatteryLevel/1000);
    StringFormat(expand_bat, "%1.2f", (float)SensorValue[Expander_Status]/275);
    StringFormat(backup_bat, "%1.2f", (float)BackupBatteryLevel/1000);
    StringConcatenate(regular_bat, "V ");
    StringConcatenate(regular_bat, expand_bat);
    StringConcatenate(regular_bat, "V ");
    StringConcatenate(regular_bat, backup_bat);
    StringConcatenate(regular_bat, "V");
    clearLCDLine(0);
    clearLCDLine(1);
    displayLCDCenteredString(0, "Cortx PwrEx Bckup");
    displayLCDCenteredString(1, regular_bat);
    wait1Msec(100);
  }
}

It takes strings, assigns them to a formatted version of each battery voltages, and concatenates them all to a single string. Then the ‘displayLCDCenteredString(line#, string)’ part is what actually displays the text. It’s good to clear the LCD line first.

Maybe your LCD display broke. Ours did at the Central Valley tournament and caused us to be immobile for one match. It’s a curse! (We were the team right behind your table :D)

But in all seriousness, check your connections. The code is the same regardless of whether it’s competition or not. Can you post your code?

By the way, your description of the right wire being yellow contradicts your picture.

ohai

We have nearly the same code, but one thing to make sure is that you are not using a y-cable (as in the one for motors) on your LCD, and that you are using the !expensive! lcd cable that vex sells.

(remember us? “illegal” rubber bands :D)

#pragma config(Sensor, dgtl7, solenoid, sensorDigitalOut)
#pragma config(Motor, port1, leftArm2, tmotorVex393, openLoop)
#pragma config(Motor, port2, frontRight, tmotorVex393, openLoop, reversed)
#pragma config(Motor, port3, backRight, tmotorVex393, openLoop, reversed)
#pragma config(Motor, port4, frontLeft, tmotorVex393, openLoop)
#pragma config(Motor, port5, backLeft, tmotorVex393, openLoop)
#pragma config(Motor, port6, rightArm2, tmotorVex393, openLoop, reversed)
#pragma config(Motor, port7, rightarm3, tmotorVex393, openLoop, reversed)
#pragma config(Motor, port8, DeWheel, tmotorVex393, openLoop)
#pragma config(Motor, port9, Dearm, tmotorVex269, openLoop)
#pragma config(Motor, port10, leftArm3, tmotorVex393, openLoop)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//

/////////////////////////////////////////////////////////////////////////////////////////
#pragma platform(VEX)

//Competition Control and Duration Settings
#pragma competitionControl(Competition)
#pragma autonomousDuration(20)
#pragma userControlDuration(255)// Motor Speeds

#define SPEED_FORWARD_FULL (127)
#define SPEED_STOP (0)
#define SPEED_REVERSE_FULL (-127)
#define BUTTON_PRESSED (1)
#define ARM_RAISE_FULL (127)
#define ARM_LOWER_FULL (-127)
#define ARM_RAISE_THREEQUARTER (90)
#define ARM_LOWER_THREEQUARTER (-90)
#define TREAD_INTAKE_FULL (127)
#define TREAD_EJECT_FULL (-127)

// Button States
#include “Vex_Competition_Includes.c” //Main competition background code…do not modify!
/*
Code Chooser
ROBOTC on VEX 2.0 Cortex

This program uses the Display functions of ROBOTC on the VEX 2.0 Cortex platform.
It allows the user to choose from 4 different pieces of code using the left and right buttons
on the VEX LCD. Once the center button is pressed, the code corresponding with the choice is run.
This code can be adapted for competition based settings - just place the code for the first
switch case in the pre_auton function, and the code for the second switch in the autonomous task.
Replace the basic movement behaviors in the second switch with your own autonomous routines.

ROBOT CONFIGURATION
MOTORS & SENSORS:

  •   			[Name]							[Type]								[Description]
    

UART Port 2 none VEX LCD VEX LCD Screen
Motor Port 2 rightMotor VEX 3-wire module Right side motor
Motor Port 3 leftMotor VEX 3-wire module Left side motor
*/

const short leftButton = 1;
const short centerButton = 2;
const short rightButton = 4;

//Wait for Press--------------------------------------------------
void waitForPress()
{
while(nLCDButtons == 0){}
wait1Msec(5);
}
//----------------------------------------------------------------

//Wait for Release------------------------------------------------
void waitForRelease()
{
while(nLCDButtons != 0){}
wait1Msec(5);
}
//----------------------------------------------------------------

task main()
{
//Declare count variable to keep track of our choice
int count = 0;

//------------- Beginning of User Interface Code ---------------
//Clear LCD
clearLCDLine(0);
clearLCDLine(1);
//Loop while center button is not pressed
while(nLCDButtons != centerButton)
{
	//Switch case that allows the user to choose from 4 different options
	switch(count){
	case 0:
		//Display first choice
		displayLCDCenteredString(0, "Autonomous 1");
		displayLCDCenteredString(1, "<		 Enter		>");
		waitForPress();
		//Increment or decrement "count" based on button press
		if(nLCDButtons == leftButton)
		{
			waitForRelease();
			count = 3;
		}
		else if(nLCDButtons == rightButton)
		{
			waitForRelease();
			count++;
		}
		break;
	case 1:
		//Display second choice
		displayLCDCenteredString(0, "Autonomous 2");
		displayLCDCenteredString(1, "<		 Enter		>");
		waitForPress();
		//Increment or decrement "count" based on button press
		if(nLCDButtons == leftButton)
		{
			waitForRelease();
			count--;
		}
		else if(nLCDButtons == rightButton)
		{
			waitForRelease();
			count++;
		}
		break;
	case 2:
		//Display third choice
		displayLCDCenteredString(0, "Autonomous 3");
		displayLCDCenteredString(1, "<		 Enter		>");
		waitForPress();
		//Increment or decrement "count" based on button press
		if(nLCDButtons == leftButton)
		{
			waitForRelease();
			count--;
		}
		else if(nLCDButtons == rightButton)
		{
			waitForRelease();
			count++;
		}
		break;
	case 3:
		//Display fourth choice
		displayLCDCenteredString(0, "Autonomous 4");
		displayLCDCenteredString(1, "<		 Enter		>");
		waitForPress();
		//Increment or decrement "count" based on button press
		if(nLCDButtons == leftButton)
		{
			waitForRelease();
			count--;
		}
		else if(nLCDButtons == rightButton)
		{
			waitForRelease();
			count = 0;
		}
		break;
	default:
		count = 0;
		break;
	}
}

task autonomous()
{
}
task usercontrol()
{
int X2 = 0, Y1 = 0, X1 = 0, threshold = 15;

while (1 == 1)
{
// This is the main execution loop for the user control program. Each time through the loop
// your program should update motor + servo values based on feedback from the joysticks.
//create deadzone for Y1/Ch3
if(abs(vexRT[Ch3]) > threshold)
Y1 = vexRT[Ch3];
else
Y1 = 0;
//create deadzone for X1/Ch4
if(abs(vexRT[Ch4]) > threshold)
X1 = vexRT[Ch4];
else
X1 = 0;
//create deadzone for X2/Ch1
if(abs(vexRT[Ch1]) > threshold)
X2 = vexRT[Ch1];
else
X2 = 0;

//remote contorl cammand
motor[frontRight] = Y1 - X2 - X1;
motor[backRight] = Y1 - X2 + X1;
motor[frontLeft] = Y1 + X2 + X1;
motor[backLeft] = Y1 + X2 - X1;
//*************************************************************************************************************
//flap
if(vexRT[Btn6UXmtr2] == 1)// if button 6D is pressed, flap will go down
{
SensorValue[solenoid] = 1; // if button is pressed activate the solenoid.
}

if(vexRT[Btn6DXmtr2] == 1)//if button 6U is pressed the flap will go up

{
SensorValue[solenoid] = 1;
}
else

if(vexRT[Btn6UXmtr2] == 1)

{
SensorValue[solenoid] = 0; // …activate the solenoid.
}

{

}

//********************************************************************************
//de-score arm
if(vexRT[Btn5U] == 1)// if button 6D is pressed, flap will go down
{
motor[Dearm] = ARM_RAISE_FULL; // if button is pressed activate the solenoid.
}

else if(vexRT[Btn5D] == 1)//if button 6U is pressed the flap will go up
{
motor[Dearm] = ARM_LOWER_FULL;
}
else
{
motor[Dearm] = SPEED_STOP;
}
//*******************************************************************************8
//De-scorer
motor[DeWheel] = vexRT[Ch2Xmtr2];

//********************************************************************************
// Arm Control
{

		    }
	motor[leftArm2]    = vexRT[Ch3Xmtr2];  // Left Joystick Y value
	motor[leftArm3]  = vexRT[Ch3Xmtr2];
	motor[rightArm2]     = vexRT[Ch3Xmtr2];   // Right Joystick Y value
	motor[rightarm3] = vexRT[Ch3Xmtr2];   // Right Joystick Y value

}
}
break;*

yeah we renmber you, is saw a cortex do that at modesto to 8000`s
well theres the program whta you think is wrong

im doing the code chooser. whenever i try inserting my program in the “correct” place the program say s there`s a bunch of errors:confused::mad:

The program chooser example does not work, it can be modified but, to be honest, I wouldn’t bother trying to use it. If you really really want to do this then read my post here.

https://vexforum.com/showpost.php?p=229195&postcount=43

There is some code attached also that does (well used to) work. When I posted that code I preferred to have the LCD on uart1 but now would suggest you leave it on the default port which is uart2. The code that I posted would need revising to do this by removing the line

#pragma config(UART_Usage, UART1, VEX_2x16_LCD, baudRate19200, IOPins, None, None)

from each file.

Is this what you are trying to run? There are multiple problems with this code starting with the fact that you have two main tasks (you included the competition includes) Did you write all of this?

Edit:

Ok, here’s a quick revision that works (sort of). I removed all your user code, you can put that back yourself. The code will need more work as, although you make a choice, nothing is then done with that choice. I will also leave that to you.

#pragma config(Sensor, dgtl7, solenoid, sensorDigitalOut)
#pragma config(Motor, port1, leftArm2, tmotorVex393, openLoop)
#pragma config(Motor, port2, frontRight, tmotorVex393, openLoop, reversed)
#pragma config(Motor, port3, backRight, tmotorVex393, openLoop, reversed)
#pragma config(Motor, port4, frontLeft, tmotorVex393, openLoop)
#pragma config(Motor, port5, backLeft, tmotorVex393, openLoop)
#pragma config(Motor, port6, rightArm2, tmotorVex393, openLoop, reversed)
#pragma config(Motor, port7, rightarm3, tmotorVex393, openLoop, reversed)
#pragma config(Motor, port8, DeWheel, tmotorVex393, openLoop)
#pragma config(Motor, port9, Dearm, tmotorVex269, openLoop)
#pragma config(Motor, port10, leftArm3, tmotorVex393, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//

/////////////////////////////////////////////////////////////////////////////////////////
#pragma platform(VEX)

//Competition Control and Duration Settings
#pragma competitionControl(Competition)
#pragma autonomousDuration(20)
#pragma userControlDuration(255)// Motor Speeds

#define SPEED_FORWARD_FULL	(127)
#define SPEED_STOP	 (0)
#define SPEED_REVERSE_FULL	(-127)
#define BUTTON_PRESSED (1)
#define ARM_RAISE_FULL (127)
#define ARM_LOWER_FULL (-127)
#define ARM_RAISE_THREEQUARTER (90)
#define ARM_LOWER_THREEQUARTER (-90)
#define TREAD_INTAKE_FULL (127)
#define TREAD_EJECT_FULL (-127)

// Button States
#include "Vex_Competition_Includes.c" //Main competition background code...do not modify!
/*
Code Chooser
ROBOTC on VEX 2.0 Cortex

This program uses the Display functions of ROBOTC on the VEX 2.0 Cortex platform.
It allows the user to choose from 4 different pieces of code using the left and right buttons
on the VEX LCD. Once the center button is pressed, the code corresponding with the choice is run.
This code can be adapted for competition based settings - just place the code for the first
switch case in the pre_auton function, and the code for the second switch in the autonomous task.
Replace the basic movement behaviors in the second switch with your own autonomous routines.

ROBOT CONFIGURATION
MOTORS & SENSORS:
*	 [Name]	 [Type]	 [Description]
UART Port 2	 none	 VEX LCD	 VEX LCD Screen
Motor Port 2	 rightMotor	 VEX 3-wire module	 Right side motor
Motor Port 3	 leftMotor	 VEX 3-wire module	 Left side motor
*/

const short leftButton   = kButtonLeft;
const short centerButton = kButtonCenter;
const short rightButton  = kButtonRight;

//Wait for Press--------------------------------------------------
void waitForPress()
{
    while(nLCDButtons == 0){
        wait1Msec(5);
    }
}
//----------------------------------------------------------------

//Wait for Release------------------------------------------------
void waitForRelease()
{
    while(nLCDButtons != 0){
        wait1Msec(5);
    }
}
//----------------------------------------------------------------


task chooser()
{
    //Declare count variable to keep track of our choice
    int count = 0;

    wait1Msec(250);
    
    //------------- Beginning of User Interface Code ---------------
    //Clear LCD
    clearLCDLine(0);
    clearLCDLine(1);
    //Loop while center button is not pressed
    while(nLCDButtons != centerButton)
    {
        //Switch case that allows the user to choose from 4 different options
        switch(count){
        case 0:
            //Display first choice
            displayLCDCenteredString(0, "Autonomous 1");
            displayLCDCenteredString(1, "<	 Enter	 >");
            waitForPress();
            //Increment or decrement "count" based on button press
            if(nLCDButtons == leftButton)
            {
                waitForRelease();
                count = 3;
            }
            else if(nLCDButtons == rightButton)
            {
                waitForRelease();
                count++;
            }
            break;
        case 1:
            //Display second choice
            displayLCDCenteredString(0, "Autonomous 2");
            displayLCDCenteredString(1, "<	 Enter	 >");
            waitForPress();
            //Increment or decrement "count" based on button press
            if(nLCDButtons == leftButton)
            {
                waitForRelease();
                count--;
            }
            else if(nLCDButtons == rightButton)
            {
                waitForRelease();
                count++;
            }
            break;
        case 2:
            //Display third choice
            displayLCDCenteredString(0, "Autonomous 3");
            displayLCDCenteredString(1, "<	 Enter	 >");
            waitForPress();
            //Increment or decrement "count" based on button press
            if(nLCDButtons == leftButton)
            {
                waitForRelease();
                count--;
            }
            else if(nLCDButtons == rightButton)
            {
                waitForRelease();
                count++;
            }
            break;
        case 3:
            //Display fourth choice
            displayLCDCenteredString(0, "Autonomous 4");
            displayLCDCenteredString(1, "<	 Enter	 >");
            waitForPress();
            //Increment or decrement "count" based on button press
            if(nLCDButtons == leftButton)
            {
                waitForRelease();
                count--;
            }
            else if(nLCDButtons == rightButton)
            {
                waitForRelease();
                count = 0;
            }
            break;
        default:
            count = 0;
            break;
        }
    }
}

void pre_auton()
{
    StartTask( chooser );

    while(bIfiRobotDisabled)
        Wait1Msec(10);
}

task autonomous()
{
    while(1) wait1Msec(10);
}
    
task usercontrol()
{
    while(1) wait1Msec(10);
}

thanks that will help a lot

task usercontrol()
{
while(1)
int X2 = 0, Y1 = 0, X1 = 0, threshold = 15;
{
// This is the main execution loop for the user control program. Each time through the loop
// your program should update motor + servo values based on feedback from the joysticks.
//create deadzone for Y1/Ch3
if(abs(vexRT[Ch3]) > threshold)
Y1 = vexRT[Ch3];
else
Y1 = 0;
//create deadzone for X1/Ch4
if(abs(vexRT[Ch4]) > threshold)
X1 = vexRT[Ch4];
else
X1 = 0;
//create deadzone for X2/Ch1
if(abs(vexRT[Ch1]) > threshold)
X2 = vexRT[Ch1];
else
X2 = 0;

//remote contorl cammand
motor[frontRight] = Y1 - X2 - X1;
motor[backRight] = Y1 - X2 + X1;
motor[frontLeft] = Y1 + X2 + X1;
motor[backLeft] = Y1 + X2 - X1;
//*************************************************************************************************************
//flap
if(vexRT[Btn6UXmtr2] == 1)// if button 6D is pressed, flap will go down
{
SensorValue[solenoid] = 1; // if button is pressed activate the solenoid.
}

if(vexRT[Btn6DXmtr2] == 1)//if button 6U is pressed the flap will go up

{
SensorValue[solenoid] = 1;
}
else

if(vexRT[Btn6UXmtr2] == 1)

{
SensorValue[solenoid] = 0; // …activate the solenoid.
}

{

}

//********************************************************************************
//de-score arm
if(vexRT[Btn5UXmtr2] == 1)// if button 6D is pressed, flap will go down
{
motor[Dearm] = ARM_RAISE_FULL; // if button is pressed activate the solenoid.
}

else if(vexRT[Btn5DXmtr2] == 1)//if button 6U is pressed the flap will go up
{
motor[Dearm] = ARM_LOWER_FULL;
}
else
{
motor[Dearm] = SPEED_STOP;
}
//*******************************************************************************8
//De-scorer
motor[DeWheel] = vexRT[Ch2Xmtr2];

//********************************************************************************
// Arm Control
{

		    }
	motor[leftArm2]    = vexRT[Ch3Xmtr2];  // Left Joystick Y value
	motor[leftArm3]  = vexRT[Ch3Xmtr2];
	motor[rightArm2]     = vexRT[Ch3Xmtr2];   // Right Joystick Y value
	motor[rightarm3] = vexRT[Ch3Xmtr2];   // Right Joystick Y value

}

heres my user control. when ever i try to add this theres errors. oh yeah when i added my autonmouses into the rivision it worked