|
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.
|