View Single Post
  #45   Spotlight this post!  
Unread 16-03-2004, 13:26
10intheCrunch's Avatar
10intheCrunch 10intheCrunch is offline
Who's John V-Neun?
AKA: Alex Baxter
None #0254 (Cheesy Poofs)
Team Role: College Student
 
Join Date: Feb 2004
Rookie Year: 2004
Location: San Jose, CA
Posts: 129
10intheCrunch is a jewel in the rough10intheCrunch is a jewel in the rough10intheCrunch is a jewel in the rough10intheCrunch is a jewel in the rough
Send a message via AIM to 10intheCrunch
Re: quick question: TIMERS

Quote:
Originally Posted by Xufer
i got my ded reckoning worked out and i have a switch wired up to switch between the two modes how would i do that using case statements?

it should be something like


case1 if (rc_dig_in_10=1)
{auton 1}

case2 else(rc_dig_in10=0)
{auton 2}

i read about them but how would they be used to work with a digital input from the rc
You don't need to use case statements, but there are a couple other things you have to do.

When you enter autonomous mode, all inputs are reset to neutral, so you have to capture the value from rc_dig_in_10 before autonomous turns on. Create a prevRcDigIn10 variable, and set that equal to the current one at the end of every loop (right before putdata()), then when you move into autonomous, look at that previous varialbe, not the real one (the "real" one will always be zero).
__________________
~Alex Baxter
Programming, Arms operation, Team 254