|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#5
|
||||
|
||||
|
Re: whileHeld() Motor Program Issue
I went through the code more closely than last time...
JoystickButton inherits whileHeld from Button. Button extends Trigger. whileHeld calls Trigger's whileActive method From Javadoc: Code:
whileActive public void whileActive(Command command) Constantly starts the given command while the button is held. Command.start() will be called repeatedly while the trigger is active, and will be canceled when the trigger becomes inactive. Parameters: command - the command to start Command.start() adds the command to a vector of command that should be added to the list of commands that the scheduler will process. Here's the catch, the scheduler doesn't do anything with the command if the command is already in the list. See line 145. So I agree. whileHeld should work as advertised. I know that I've had trouble with it in the past, and have always implemented commands as I outlined above. Maybe the problems I had with whileHeld were actually with something else, I haven't gone back to investigate. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|