}
public static class DriveTrain {
- public static final int TANK_DRIVE = 0;
- public static final int ARCADE_DRIVE = 1;
- public static final int DRIVE_TYPE = TANK_DRIVE;
+ public static final int TANK = 0;
+ public static final int ARCADE = 1;
+ public static final int DRIVE_TYPE = TANK;
// Drivetrain Motor related ports
public static final int DRIVE_FRONT_LEFT = 1;
public static final Value RETRACT = DoubleSolenoid.Value.kReverse;
public static final int IN = 1;
+ public static final int STOP = 0;
public static final int OUT = -1;
// for roller
intake = new JoystickButton(rightJoystick,
Constants.OI.RIGHT_JOYSTICK_INTAKE_PORT);
intake.whenPressed(new RunIntake(Constants.IntakeArm.IN));
+ intake.whenReleased(new RunIntake(Constants.IntakeArm.STOP));
outtake1 = new JoystickButton(rightJoystick,
Constants.OI.RIGHT_JOYSTICK_OUTTAKE_1_PORT);
outtake1.whenPressed(new RunIntake(Constants.IntakeArm.OUT));
+ outtake1.whenReleased(new RunIntake(Constants.IntakeArm.STOP));
outtake2 = new JoystickButton(rightJoystick,
Constants.OI.RIGHT_JOYSTICK_OUTTAKE_2_PORT);
outtake2.whenPressed(new RunIntake(Constants.IntakeArm.OUT));
+ outtake2.whenReleased(new RunIntake(Constants.IntakeArm.STOP));
shooterUp = new JoystickButton(rightJoystick,
Constants.OI.RIGHT_JOYSTICK_SHOOTER_UP_PORT);
protected void initialize() {
if (direction == Constants.IntakeArm.IN)
Robot.intakeArm.intakeBall();
- else
+ else if (direction == Constants.IntakeArm.OUT)
Robot.intakeArm.outputBall();
+ else
+ Robot.intakeArm.stopRollers();
}
@Override
package org.usfirst.frc.team3501.robot.subsystems;
import org.usfirst.frc.team3501.robot.Constants;
-import org.usfirst.frc.team3501.robot.Robot;
import org.usfirst.frc.team3501.robot.commands.driving.JoystickDrive;
import edu.wpi.first.wpilibj.CANTalon;
public void joystickDrive(double left, double right) {
int type = Constants.DriveTrain.DRIVE_TYPE;
double k = (isFlipped() ? -1 : 1);
- if (type == Constants.DriveTrain.TANK_DRIVE) {
+ if (type == Constants.DriveTrain.TANK) {
robotDrive.tankDrive(-left * k, -right * k);
- } else if (type == Constants.DriveTrain.ARCADE_DRIVE) {
+ } else if (type == Constants.DriveTrain.ARCADE) {
robotDrive.arcadeDrive(left * k, right);
}
}
public void setMotorSpeeds(double left, double right) {
- double k = (Robot.driveTrain.isFlipped() ? -1 : 1);
+ double k = (isFlipped() ? -1 : 1);
robotDrive.tankDrive(-left * k, -right * k);
}