It's written by Kevin Watson. We used a slightly modified version of it.
Quote:
void auton_selector(void)
{
static char last_sw1;
static char last_sw2;
if(AUTON_UP == 1 && AUTON_UP != last_sw1)
{
if(auton_select < MAXAUTONROUTINES)
auton_select++;
else
auton_select=99;
}
if(AUTON_DN == 1 && AUTON_DN != last_sw2 && auton_select > 0)
{
if (auton_select == 94)
auton_select=MAXAUTONROUTINES;
else
auton_select--;
}
last_sw1 = AUTON_UP; //oneshot the trigger and top buttons
last_sw2 = AUTON_DN;
User_Mode_Byte = auton_select;
}
|
User_Mode_Byte is the user display on the OI. Use that little button to change to it.
AUTON_UP/DOWN are the defines to which a joystick button or something similar.