Thread: Button Command
View Single Post
  #3   Spotlight this post!  
Unread 23-02-2012, 23:59
Sunstroke Sunstroke is offline
Programmer
AKA: Joe Grinstead
FRC #3504 (Girls of Steel)
Team Role: Mentor
 
Join Date: Apr 2009
Rookie Year: 2009
Location: New England
Posts: 49
Sunstroke is an unknown quantity at this point
Re: Button Command

You can also do downSwitch.whileHeld(<command goes here>);

The whileHeld method will constantly call start() on the command (which means if the command stops, it will restart, but otherwise there is no difference) while the button is held, and then it will cancel the command when the button is released (so the command will die, calling its interrupt method).
Reply With Quote