|
Re: Can't get auto mode to run with OI switches
You need to save the value of the OI reading the last cycle before you enter autonomous.
I recommend creating a char to hold the state of the OI input and updating it in Process_Data_From_Master_uP() as long as the autonomous_mode flag is not set.
Code:
unsigned char currentauto = 0; //Set outside function to make it global
void Process_Data_From_Master_uP(void)
{
Getdata(&rxdata);
if(!autonomous_mode)
currentauto = p2_wheel;
// Remainder of function
}
Then in user_routines_fast you'll need:
Code:
extern unsigned char currentauto;
to access it.
The only thing, I'm not sure if the name of the flag (autonomous_mode) is right, I don't have code to reference at the moment.
__________________
Matt Krass
If I suggest something to try and fix a problem, and you don't understand what I mean, please PM me!
I'm a FIRST relic of sorts, I remember when we used PBASIC and we got CH Flightsticks in the KoP. In my day we didn't have motorized carts, we pushed our robots uphill, both ways! (Houston 2003!)
|