View Single Post
  #3   Spotlight this post!  
Unread 06-03-2015, 09:50
Slade Slade is offline
Registered User
FRC #4471 (Spartrons)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Florida
Posts: 24
Slade is an unknown quantity at this point
Re: Timing Autonomous with While Loops?

Quote:
Originally Posted by Mark McLeod View Post
They can be CPU hogs if used incorrectly.
The Wait call inside each one throttles the loop down and avoids sucking the life out of the CPU. So never use a While loop without a Wait.

So that example works as long as you make sure to use Waits.

There are several alternative styles that avoid the use of loops altogether, but Waits are still required to get your timing down.
Here is one alternative using a Flat Sequence Structure: http://www.team358.org/files/program...php#Autonomous
Well my question would be is what if your moving a motor and you want to stop it at a limit switch, how would you go about doing so without a while loop?
Reply With Quote