/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.stuy.commands;

import edu.wpi.first.wpilibj.Compressor;
import java.lang.Math;

/**
 *
 * @author Kevin Wang
 */
public class DriveManualJoystickControl extends CommandBase {
    
    public DriveManualJoystickControl() {
        // Use requires() here to declare subsystem dependencies
        // eg. requires(chassis);
        requires(drivetrain);
    }

    // Called just before this Command runs the first time
    protected void initialize() {
        drivetrain.compressor.start();
        
    }

    // Called repeatedly when this Command is scheduled to run
    protected void execute() {
        drivetrain.tankDrive(-oi.getLeftStick().getY(), -oi.getRightStick().getY());
        // If we're driving, stop the compressor from turning on. Otherwise, it's fine.
        if ( Math.abs(oi.getLeftStick().getY()) < 0.1  || Math.abs(oi.getRightStick().getY()) < 0.1) {
            drivetrain.compressor.stop();
        } else {
            drivetrain.compressor.start();
        }
    }

    // Make this return true when this Command no longer needs to run execute()
    protected boolean isFinished() {
        return false;
    }

    // Called once after isFinished returns true
    protected void end() {
    }

    // Called when another command which requires one or more of the same
    // subsystems is scheduled to run
    protected void interrupted() {
    }
}

@@ -883,223 +883,8 @@
 ne.%0A
-        if ( Math.abs(oi.getLeftStick().getY()) %3C 0.1  %7C%7C Math.abs(oi.getRightStick().getY()) %3C 0.1) %7B%0A            drivetrain.compressor.stop();%0A        %7D else %7B%0A            drivetrain.compressor.start();%0A        %7D%0A
     

Remove compressor disablement while driving