There is
online documentation for CommandBased programming, in particular this
link shows how to attach commands to a joystick.
Code:
Joystick DriveStick = new Joystick(1);
Button button = new JoystickButton(joystick, BUTTON_NUMBER);
public OI() {
button.whenPressed(new LauncherSpinWheels());
// ...
}
Replace BUTTON_NUMBER with the button you want to run the command.
In addition to the online documentation, you might find these videos helpful if you're having trouble understanding CommandBasedProgram.:
CommandBased Programming with RobotBuilder:
http://www.youtube.com/watch?v=k7PaY...lgn vhGObeKzp
CommandBased Programming without RobotBuilder:
http://www.youtube.com/watch?v=v0vt9yKLxUQ