|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Run Command Once When Trigger is Pressed
If you're using the Command Based templates I second what Kriek is suggesting.
Ether's suggestion is the generic description of exactly what Kriek suggestion does for you. |
|
#2
|
|||
|
|||
|
Re: Run Command Once When Trigger is Pressed
Here is an example of running commands whenever a joystick button is pressed. You can also associate commands with buttons from the Cypress module or any arbitrary polled trigger (see Trigger class).
http://Wpilib.screenstepslive.com/s/3120/m/7952/l/97457 Besides using whenPressed() you can also call whenReleased() to get a command to run when the button is released or whileHeld() to get a command to repeatedly run while the button is pressed. Brad |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|