@@ -0,0 +1,1702 @@
+/*%0A * To change this template, choose Tools %7C Templates%0A * and open the template in the editor.%0A */%0Apackage edu.stuy.commands;%0A%0Aimport edu.wpi.first.wpilibj.Timer;%0A%0A/**%0A *%0A * @author Kevin Wang%0A */%0Apublic class ConveyAutomaticAuton extends CommandBase %7B%0A    double PAUSE_DURATION = 1;%0A    %0A    boolean hasTimeout = false;%0A    double timeout;%0A    double pauseTime = 0;%0A%0A    public ConveyAutomaticAuton() %7B%0A        // Use requires() here to declare subsystem dependencies%0A        // eg. requires(chassis);%0A        requires(conveyor);%0A    %7D%0A%0A    public ConveyAutomaticAuton(double timeout) %7B%0A        this();%0A        hasTimeout = true;%0A        this.timeout = timeout;%0A    %7D%0A%0A    // Called just before this Command runs the first time%0A    protected void initialize() %7B%0A        setTimeout(timeout);%0A    %7D%0A%0A    // Called repeatedly when this Command is scheduled to run%0A    protected void execute() %7B%0A        if (!flywheel.isSpeedGood()) %7B%0A            pauseTime = Timer.getFPGATimestamp();%0A            conveyor.stop();%0A        %7D%0A        else if (Timer.getFPGATimestamp() - pauseTime %3C PAUSE_DURATION %7C%7C !flywheel.isSpinning()) %7B%0A            conveyor.stop();%0A        %7D%0A        else %7B%0A            conveyor.convey();%0A        %7D%0A    %7D%0A%0A    // Make this return true when this Command no longer needs to run execute()%0A    protected boolean isFinished() %7B%0A        if (hasTimeout) %7B%0A            return isTimedOut();%0A        %7D%0A        return false;%0A    %7D%0A%0A    // Called once after isFinished returns true%0A    protected void end() %7B%0A        conveyor.stop();%0A    %7D%0A%0A    // Called when another command which requires one or more of the same%0A    // subsystems is scheduled to run%0A    protected void interrupted() %7B%0A    %7D%0A%7D%0A

Add ConveyAutomaticAuton which pauses conveyor for one second when the flywheel speed is bad.