View Single Post
  #6   Spotlight this post!  
Unread 26-01-2014, 12:01
iggy_gim's Avatar
iggy_gim iggy_gim is offline
Registered User
AKA: Theodore Kim
FRC #5123 (Mechadogs)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2012
Location: Yonkers, NY
Posts: 79
iggy_gim is on a distinguished road
Re: Timing Motor Functions in Teleop

Quote:
Originally Posted by Captain Planet View Post
First of all, Teleop is not the place to put this. Teleop is called around every 20 ms, if I recall correctly, so anything slower than that will "freeze" up teleop and make your controls unresponsive. So, instead you should place timed sequences like this in Periodic Tasks. As to how you would actually make the motor run for 5 seconds, there are a couple ways. You could do something like this, or just make a while loop with a 5000 ms delay in it that only runs once, and then put that inside a case structure to control it.
Thank you the second method solved my problem.
Reply With Quote