|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Command-based while button presed
I want to run a specific command but i only want to run it when the button is pressed but i cant find the specific function for that
Code:
OI.controlDriver.buttonA.whenPressed(RobotMap.intakeIn);
OI.controlDriver.buttonA.whenReleased(RobotMap.intakeIn);
OI.controlDriver.buttonB.whileHeld(RobotMap.intakeOut);
|
|
#2
|
||||
|
||||
|
Re: Command-based while button presed
Quote:
Psuedocode: Code:
isFinished() {
when (frisbeeIsLoaded)
return true;
}
Code:
isFinished() {
return isTimedOut();
}
Last edited by F22Rapture : 21-01-2013 at 19:42. |
|
#3
|
||||
|
||||
|
We found somewhere in the documentation where u need to put it in the interrupted function and it worked for us.
|
|
#4
|
||||
|
||||
|
Re: Command-based while button presed
Quote:
On a slightly related topic, can I wipe the commands currently linked to a button? i can do button.whilePressed(); but can i do button.releaseCommands(); so that it no longer runs the commands issued by .whilePressed() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|