Yes, it connects to the Operator Interface at the driver controls.
I've attached a photo of a Disable/Auto switch on our '08 robot controls.
It happens to be out in my van for an appearance at the Special Olympics tomorrow.
If you want to use one of the joystick buttons to trigger it as well, the Autonomous routine can be rewritten slightly to accommodate being called two different ways. I'd prefer not to flat-out clobber the autonomous mode flag, but to structure the code such that either way will trigger the auto routine.
Had one team fail year after year on the playing field whenever a particular mentor would return every-other year to help them. Always turned out he would overwrite the autonomous mode flag with a joystick switch so the real flag would never work. It's a bad habit to start.
Maybe something along the lines of (in User_Autonomous_Code and main.c):
Code:
while (autonomous_mode || (p1_sw_trig == 1) ) /* DO NOT CHANGE! */
You'd also need to modify main.c with the same statement modification to get it to start and the joystick button would act as a dead-man switch. You'd have to hold it to keep autonomous running. Letting go would stop it.
What might be simpler for you right now is to just call an auto routine like that in post #14 directly from user_routines.c whenever the button is held down. a la,
Code:
void Process_Data_From_Master_uP(void)
{
static unsigned char i;
Getdata(&rxdata); /* Get fresh data from the master microprocessor. */
if (p1_sw_trig == 1)
{
Autonomous();
}
else
Default_Routine(); /* Optional. See below. */
You don't have to be in Autonomous Mode to run some autonomous routine in teleop.
P.S. If you add a new routine like Autonomous(), depending on where you add it you may need to declare it in one of the header files (.h) so the compiler knows where to find it.