|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#20
|
|||||
|
|||||
|
Re: Older FRC autonomous code
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! */ 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. */
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. Last edited by Mark McLeod : 02-05-2010 at 08:09. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Autonomous 2010 FRC | Drucifur | Java | 10 | 14-02-2010 08:06 |
| FRC...autonomous or driver-controlled competition? | tribotec_ca88 | General Forum | 28 | 10-03-2005 14:47 |
| Autonomous code | PBoss | Programming | 7 | 14-01-2003 15:29 |
| Autonomous Code | Adrian Wong | Robotics Education and Curriculum | 1 | 18-11-2002 22:34 |