how many lcd pages can you make?
Thanks
Someone can correct me if I’m somehow wrong, but I don’t think there’s theoretically any limit. You tell the code, “If this button is pressed, add 1 to the page number.” And then the page number corresponds to text on screen. I don’t know what language you’re using, but this is the basic idea. I’ve used an LCD screen for autonomous selection, and I had 8 or so pages I believe… Page number is just a variable that can be used to tell the screen what it should display.
thank you
As many as will fit into memory, which means more than you will have time to scroll through during a match.
clearLCDLine(0);
clearLCDLine(1);
//Loop while center button is not pressed
while(nLCDButtons != centerButton)
{
bLCDBacklight = true;
//Switch case that allows the user to choose from 4 different options
switch(count){
case 0:
//Display first choice
displayLCDCenteredString(0, “R Left/B Right C”);
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, “R Right/B Left C”);
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, “B Left/R Right S”);
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, "B Right/R Left S ");
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;
case 4:
//Display first choice
displayLCDCenteredString(0, “porgamming sklls”);
displayLCDCenteredString(1, “< Enter >”);
waitForPress();
//Increment or decrement “count” based on button press
if(nLCDButtons == leftButton)
{
waitForRelease();
count --;
}
else if(nLCDButtons == rightButton)
{
waitForRelease();
count = 0;
}
default:
count = 0;
break;
}
}
}
/---------------------------------------------------------------------------/
/* /
/ Autonomous Task /
/ /
/ This task is used to control your robot during the autonomous phase of /
/ a VEX Competition. /
/ /
/ You must modify the code to add your own robot specific commands here. /
/---------------------------------------------------------------------------*/
// you have to times the number by 27
task autonomous()
{
//Clear LCD
clearLCDLine(0);
clearLCDLine(1);
//Switch Case that actually runs the user choice
switch(count){
case 0:
//If count = 0, run the code correspoinding with choice 1
displayLCDCenteredString(0, “Red Left Blue Right Cube”);
displayLCDCenteredString(1, “is running!”);
wait1Msec(250); // Robot waits for 250 milliseconds
autonopenclaw();
autonliftarm(1400);
autonlowerarm();
autonlock();
autonDriveforwards(25 * 27);
autonTurnleft(127,90);
autonDriveforwards(3227);
autoncloseclaw();
autonliftarm(200);
autonTurnleft(127,95);
autonDrivebackwards(29 * 27);
autondump();
autonDriveforwards(327);
wait1Msec(200);
autonlowerarm();
autonTurnright(127, 10);
autonDriveforwards(29*27);
autoncloseclaw();
autonDrivebackwards(31 * 27);
autondump();
break;
case 1:
//If count = 1, run the code correspoinding with choice 2
displayLCDCenteredString(0, “Red Right Blue Left Cube”);
displayLCDCenteredString(1, “is running!”);
wait1Msec(250); // Robot waits for 250 milliseconds
autonopenclaw();
autonliftarm(1400);
autonlowerarm();
wait1Msec(200);
autonlock();
autonDriveforwards(25 * 27);
autonTurnright(127,90);
autonDriveforwards(3227);
autoncloseclaw();
autonliftarm(400);
autonTurnright(127,95);
autonDrivebackwards(29 * 27);
autondump();
autonDriveforwards(327);
wait1Msec(200);
autonlowerarm();
autonTurnleft(127, 10);
autonDriveforwards(29*27);
autoncloseclaw();
autonDrivebackwards(31 * 27);
autondump();
break;
case 2:
//If count = 2, run the code correspoinding with choice 3
displayLCDCenteredString(0, “Blue Left Red Right Star”);
displayLCDCenteredString(1, “is running!”);
wait1Msec(250); // Robot waits for 250 milliseconds
autonopenclaw();
autonliftarm(1400);
autonlowerarm();
wait1Msec(200);
autonlock();
autonDriveforwards(48*27);
autoncloseclaw();
autonliftarm(500);
autonDrivebackwards(48*27);
autonTurnright(127,90);
autonDrivebackwards(60*27);
autondump();
autonlowerarm();
autonDriveforwards(24*27);
autonTurnleft(127,90);
autonDriveforwards(32*27);
autoncloseclaw();
autonTurnright(127,90);
autonDrivebackwards(19*27);
break;
case 3:
//If count = 3, run the code correspoinding with choice 4
displayLCDCenteredString(0, “Blue Right Red Left stars”);
displayLCDCenteredString(1, “is running!”);
wait1Msec(250); // Robot waits for 250 milliseconds
autonopenclaw();
autonliftarm(1400);
autonlowerarm();
wait1Msec(200);
autonlock();
autonDriveforwards(48*27);
autoncloseclaw();
autonliftarm(500);
autonDrivebackwards(48*27);
autonTurnleft(127,90);
autonDrivebackwards(60*27);
autondump();
autonlowerarm();
autonDriveforwards(24*27);
autonTurnright(127,90);
autonDriveforwards(32*27);
autoncloseclaw();
autonTurnleft(127,90);
autonDrivebackwards(19*27);
autondump();
break;
case 4:
//If count = 3, run the code correspoinding with choice 4
displayLCDCenteredString(0, “p skills”);
displayLCDCenteredString(1, “is running!”);
wait1Msec(250);
default:
displayLCDCenteredString(0, “No valid choice”);
displayLCDCenteredString(1, “was made!”);
break;
default:
displayLCDCenteredString(0, “No valid choice”);
displayLCDCenteredString(1, “was made!”);
break;
}
it is still not working
what should i do?
Someone hasn’t played No Man’s Sky…
What doesn’t work. Also try reposting the code with the code tags ( button that looks like </>)