View Single Post
  #2   Spotlight this post!  
Unread 19-02-2006, 01:47
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Sending variables to Auto Mode

The problem is simple. When autonomous mode begins, all inputs from the OI are set to their neutral/off state. So neither trig_fwd nor trig_rev will be active when you read them the first time after the autonomous mode flag is set.

Fortunately, the solution too is simple. Instead of always calling Process_Data_From_Master_uP(), inside main(), only call it if you're not in autonomous mode. Make it the else clause of your if (autonomous_mode) statement. Make position a global (or static local) variable so you can use it later.