View Single Post
  #5   Spotlight this post!  
Unread 17-01-2014, 08:22
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Teleop move motor forward and backwards timed

I think you'll also discover that you will want a fourth step, to stop the motor after the 1.5 seconds. And as Mark said, if you take the motor reference out of each sequence and wire it across, the code will be smaller and cleaner.

By the way, putting this into teleop wouldn't simply slow it down. If you place an infinite loop into a function, the function becomes, ... , ...? Yep, it becomes infinite as well. So by placing an infinite loop in teleop, you would only call telop once and your teleop portion of your program would pretty much lock up waiting for the loop to finish.

Greg McKaskle
Reply With Quote