View Single Post
  #4   Spotlight this post!  
Unread 12-03-2012, 21:33
tux tux is offline
Registered User
AKA: Lee Harr
FRC #3842 (Shock-a-Bots)
Team Role: Mentor
 
Join Date: Apr 2005
Rookie Year: 2005
Location: Rochester, NY
Posts: 91
tux is an unknown quantity at this point
Re: Infinite loop means no control

Quote:
Originally Posted by virtuald View Post
if you're in a loop waiting for some switch or condition to change without doing anything else... you're probably doing it wrong.
But it made the autonomous code so simple. And it worked great ... until the mechanism broke down.


I could do:

Code:
while not throwerToReady():
    Wait(0.01)

throw():

If you have to go through the whole loop each time, you must have to create some kind of state machine.

By tooling Wait to watch for mode changes the simple style could work.
Reply With Quote