View Single Post
  #1   Spotlight this post!  
Unread 26-01-2012, 21:37
neal's Avatar
neal neal is offline
Neal
FRC #1777 (Viking Robotics)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2009
Location: United States
Posts: 56
neal is an unknown quantity at this point
A good time based way to program

Whenever my mentors ask me if I can program a motor to run for x seconds, I always feel it's not the best way to do that.

For example, press a button and the motor will run for x seconds and then stop.

All I can think of to do that is simply using Timer() class, but then I feel using multiple timers, if else's for them is not just the best way to do it.

Is there any other better way to do this or is using Timer() fine?

All your thoughts are much appreciated!
Reply With Quote