View Single Post
  #5   Spotlight this post!  
Unread 27-04-2004, 07:33
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Multiple Auton's

We used 5 switches on the OI: 1 for side select, 4 for auton select. Each of the 4 switches represents a bit. We set a variable with these values in Process_Data_From_Master_uP() (which got me to notice the bug in main.c).

For Auton, we do this:
Code:
//...
while (autonomous_mode)   /* DO NOT CHANGE! */
{
 // Do instructions
 switch (AUTON_MODE)
 {
  case 0:
   //Do nothing
   break;
  case 1:
   Auton_1(); break;
  case 2:
   Auton_2(); break;
  case 3:
   Auton_3(); break;
  //...
 }
 if (statusflag.NEW_SPI_DATA)      /* 26.2ms loop area */
 {
  Getdata(&rxdata);   //DO NOT DELETE, or you will be stuck here forever!   
  Putdata(&txdata);   // DO NOT DELETE, or you will get no PWM outputs!
  Generate_PWMs(pwm13, pwm14, pwm15, pwm16);
 }
 Process_Data_From_Local_IO();
}// End Loop
Then, we wrote the Auton's in seperate files.