Driver Control Problems

Hi all,
Whenever our team puts something in the pre_auton our driver does not work for some reason and we are not sure why, here is a copy of our code, all help is appreciated. Also does anyone know how to turn on a backlight for the LCD screen?

-team 53C

void pre_auton()
{
// Set bStopTasksBetweenModes to false if you want to keep user created tasks running between
// Autonomous and Tele-Op modes. You will need to manage all user created tasks if set to false.
bStopTasksBetweenModes = true;
autoSelection();
}

void autoSelection()
{
clearLCD();
while (nLCDButtons != 2)
{
displayLCDCenteredString(0, “Autonomous”);
displayLCDNumber(0, 14, autoMode, 2);
displayLCDCenteredString(1, “<< Selection >>”);
if (nLCDButtons == 1)
{
autoMode–;
while(nLCDButtons == 1)
{
wait1Msec(10);
}
}
if (nLCDButtons == 4)
{
autoMode++;
while (nLCDButtons == 4)
{
wait1Msec(10);
}
}
if (autoMode < 1)
{
autoMode = 12;
}
else if (autoMode > 12)
{
autoMode = 1;
}
wait1Msec(10);
}
clearLCD();
}

//-------------Autonomous Code-------------//

task autonomous()
{
if (autoMode == 1)
{
auto1();
}
else if (autoMode == 2)
{
auto2();
}
else if (autoMode == 3)
{
auto3();
}
else if (autoMode == 4)
{
auto4();
}
else if (autoMode == 5)
{
auto5();
}
else if (autoMode == 6)
{
auto6();
}
else if (autoMode == 7)
{
auto7();
}
else if (autoMode == 8)
{
auto8();
}
else if (autoMode == 9)
{
auto9();
}
else if (autoMode == 10)
{
auto10();
}
else if (autoMode == 11)
{
auto11();
}
else if (autoMode == 12)
{
auto12();
}
}

So recently I was trying to address the lack of good example code for LCD control in competition. It will ensure you always have full control of the robot and not get stuck in LCD selection.

I built the LCD control into the competition template so that people didn’t just take the code chooser and add it line by line to their existing program. I only added like 50 lines of code to make it work anyway.

Alright i will try this and get back thanks!

So once i get into auto i should make it stop?

Ya. The task that is selecting should be killed if you get into autonomous without having selected anything. Also it should be killed if you go into driver without ever having run autonomous. (what your issue had been)

Pre auto runs upon start up even if your just going straight into driver control.