in OI:
Code:
JoystickButton doStuff = new JoystickButton(joysticknumber, buttonnumber);
doStuff.whenReleased(new Shoot());
Make a command called Shoot
Code:
package edu.wpi.first.wpilibj.templates.commands;
/**
*
* @author Thundrio
*/
public class ExampleCommand extends CommandBase {
Timer t = new Timer();
protected void initialize() {
shooterMotors.set(1);
t.reset();
t.start();
}
protected void execute() {
shooterMotors.set(1);
if (t.get() >= 1)
solenoid.extend();
}
protected boolean isFinished() {
if (solenoid.isExtended())
return true;
else
return false;
}
protected void end() {
shooterMotors.set(0);
}
}
Something like that. Replace the placeholder stuff with your own commands and subsystems obviously, and add a constructor and all.