View Single Post
  #9   Spotlight this post!  
Unread 15-03-2005, 16:29
bombadier337's Avatar
bombadier337 bombadier337 is offline
1337 U53R
AKA: Shaver
None #1541 (MidloCANics)
Team Role: College Student
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Richmond VA
Posts: 123
bombadier337 is just really nicebombadier337 is just really nicebombadier337 is just really nicebombadier337 is just really nice
Send a message via AIM to bombadier337
Re: Setting Autonomous Settings from OI

We set it from the OI as well. What I did was put a line of code in the Process_Data_From_Master routine (I probably spelled tha wrong, I haven't actually looked at the code in a while) that reads a switch on the OI (we plugged a switch on joystick 3 and made the switch use the two auxilary digital inputs) Depending on the value the switch gave, we could have 3 different autonomous modes. Basically, when the robot was disabled it was constantly checking the status of the switch and updating the value of the auto_mode variable. As soon as autonomous mode hit there were 3 if statements, basically

if(auto_mode==0)
{
//automode1
}
else if(auto_mode==1)
{
//automode2
}
else if(auto_mode==2)
{
//automode2
}

It probably wasn't the most efficient code, but it worked flawlessly so I was happy. If anyone wants to see the actual code just tell me, I just don't feel like going and grabbing my laptop right now.
__________________
Midlothian High School - Team 1541
2005 Radioshack Innovation in Control - NASA/VCU Regional
2005 Rookie Inspiration - NASA/VCU Regional