New to Command Based... We are about to start coding the commands for each subsystem and before we get too far, we need the following info on how to handle multiple commands...
For example, we have a feeder motor... we want a command to FeederOn(clockwise), FeederOnRev(counterclockwise) and FeederOff...
We created a Feeder_Command class...
Code:
public class TeleopFeederOn_Command extends Command{
@Override
protected void execute(){
while(Robot.oi.getOperatorJoystick().getRawButton(4) ==true){
Robot.fuelFeederSubsystem.FeederOn();
}
Robot.fuelFeederSubsystem.FeederOff();
}
@Override
protected boolean isFinished() {
// TODO Auto-generated method stub
return false;
}
@Override
protected void end() {
Robot.fuelFeederSubsystem.FeederOff();
}
@Override
protected void interrupted(){
end();
}
}
That should take care of our FeederOn command using button 4. Now should we build a new command class for FeederOnRev (button5) or do we want to add the command to this class?