View Single Post
  #4   Spotlight this post!  
Unread 14-04-2006, 01:02
Matt Krass's Avatar
Matt Krass Matt Krass is offline
"Old" and Cranky. Get off my lawn!
AKA: Dark Ages
FRC #0263 (Sachem Aftershock)
Team Role: Mentor
 
Join Date: Oct 2002
Rookie Year: 2002
Location: Long Island, NY
Posts: 1,187
Matt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond repute
Send a message via AIM to Matt Krass
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!)