View Single Post
  #3   Spotlight this post!  
Unread 26-01-2014, 11:56
Captain Planet Captain Planet is offline
Apprentice Programmer
FRC #2500 (Herobotics)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2012
Location: Minneapolis, MN
Posts: 7
Captain Planet is an unknown quantity at this point
Re: Timing Motor Functions in Teleop

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.
Reply With Quote