Thread: Timed Button
View Single Post
  #2   Spotlight this post!  
Unread 17-03-2009, 21:44
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: Timed Button

I'd suggest using a periodic loop for this. In the loop, check the button and wire to a switch. In the True case of the switch, turn on the motor, delay for the right amount of time, and set the motor speed to zero. Then return to scanning the button. To sequence the motor on/delay/motor off, you can use a dataflow dependency or a sequence structure.

As with the other periodic loop, put a delay in it to read the joystick at 50Hz or so.

Greg McKaskle
Reply With Quote