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);
}
}
/***
- * 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;
}
/***
}
public void stop() {
- setArmSpeed(0);
+ setArmSpeeds(0);
}
public double getAngleForLevel(double targetLevel) {