X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fsubsystems%2FIntakeArm.java;h=8c87ed1c66a6c5a1172f50cde669607c99628b0f;hb=0a179caa3cb1017af9fc7dab08c7123c3407e84f;hp=5e00d05f0df999e6870ba06e5b32d8bee168002d;hpb=03926b5fa23be90ab6c5ad77c3204a8b94fc02ed;p=3501%2Fstronghold-2016 diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/IntakeArm.java b/src/org/usfirst/frc/team3501/robot/subsystems/IntakeArm.java index 5e00d05f..8c87ed1c 100755 --- a/src/org/usfirst/frc/team3501/robot/subsystems/IntakeArm.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/IntakeArm.java @@ -21,14 +21,16 @@ import edu.wpi.first.wpilibj.command.Subsystem; public class IntakeArm extends Subsystem { private CANTalon intakeRoller; - private CANTalon intakeArm; + private CANTalon leftIntakeArm; + private CANTalon rightIntakeArm; private AnalogPotentiometer intakePot; public static double[] potAngles = { 0, 30, 45, 90 }; // TODO: correct angles public static double moveIntakeArmSpeed = 0; public IntakeArm() { intakeRoller = new CANTalon(Constants.IntakeArm.ROLLER_PORT); - intakeArm = new CANTalon(Constants.IntakeArm.ARM_PORT); + leftIntakeArm = new CANTalon(Constants.IntakeArm.LEFT_ARM_PORT); + rightIntakeArm = new CANTalon(Constants.IntakeArm.RIGHT_ARM_PORT); intakePot = new AnalogPotentiometer(Constants.IntakeArm.POT_CHANNEL, Constants.IntakeArm.FULL_RANGE, Constants.IntakeArm.OFFSET); } @@ -68,36 +70,58 @@ public class IntakeArm extends Subsystem { } /*** - * This method sets the voltage of the arm motor. The range is from [-1,1]. A - * negative voltage makes the direction of the motor go backwards. + * This method sets the voltages of the arm motors. The range is from [-1,1]. + * A negative voltage makes the direction of the motor go backwards. * * @param voltage - * The voltage that you set the motor at. The range of the voltage of - * the arm motor is from [-1,1]. A negative voltage makes the - * direction of the motor go backwards. + * The voltage that you set the motors at. The range of the voltage + * of the arm motors is from [-1,1]. A negative voltage makes the + * direction of the motors go backwards. */ - public void setArmSpeed(double voltage) { + public void setArmSpeeds(double voltage) { if (voltage > 1) voltage = 1; else if (voltage < -1) voltage = -1; - intakeArm.set(voltage); + leftIntakeArm.set(voltage); + rightIntakeArm.set(voltage); } /*** - * This method gets you the current voltage of the motor that controls the - * intake arm. The range of voltage is from [-1,1]. A negative voltage makes - * the motor run backwards. + * This method gets you the current voltage of the left motor that controls + * the intake arm. The range of voltage is from [-1,1]. A negative voltage + * makes the motor run backwards. + * + * @return Returns the voltage of the left motor that controls the arm. The + * range of the voltage goes from [-1,1]. A negative voltage indicates + * that the motor is running backwards. + */ + + public double getLeftArmSpeed() { + return leftIntakeArm.get(); + } + + /*** + * This method gets you the current voltage of the right motor that controls + * the intake arm. The range of voltage is from [-1,1]. A negative voltage + * makes the motor run backwards. * - * @return Returns the voltage of the motor that controls the arm. The range - * of the voltage goes from [-1,1]. A negative voltage indicates that - * the motor is running backwards. + * @return Returns the voltage of the right motor that controls the arm. The + * range of the voltage goes from [-1,1]. A negative voltage indicates + * that the motor is running backwards. */ + public double getRightArmSpeed() { + return rightIntakeArm.get(); + } + + public CANTalon getLeftIntakeArmMotor() { + return leftIntakeArm; + } - public double getArmSpeed() { - return intakeArm.get(); + public CANTalon getRightIntakeArmMotor() { + return rightIntakeArm; } /*** @@ -137,7 +161,7 @@ public class IntakeArm extends Subsystem { } public void stop() { - setArmSpeed(0); + setArmSpeeds(0); } public double getAngleForLevel(double targetLevel) {