add setArmVoltage and getArmVoltage methods
authorShaina Chen <shaina.sierra@gmail.com>
Fri, 5 Feb 2016 04:12:48 +0000 (20:12 -0800)
committerShaina Chen <shaina.sierra@gmail.com>
Fri, 5 Feb 2016 04:21:49 +0000 (20:21 -0800)
src/org/usfirst/frc/team3501/robot/subsystems/IntakeArm.java

index 3fa5d3e9e956daace2d96f3c18ead2a6fec82dda..7140b83e799908f173e6229711a164b778cf0aff 100755 (executable)
@@ -50,7 +50,7 @@ public class IntakeArm extends Subsystem {
 
   /***
    * This method gets you the current voltage of the motor that controls the
-   * intake arm. The range of voltage is from [-1,1].
+   * intake arm roller. 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 roller. The
@@ -62,6 +62,39 @@ public class IntakeArm extends Subsystem {
     return intakeRoller.get();
   }
 
+  /***
+   * 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.
+   *
+   * @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.
+   */
+
+  public void setArmVoltage(double voltage) {
+    if (voltage > 1)
+      voltage = 1;
+    else if (voltage < -1)
+      voltage = -1;
+
+    intakeArm.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.
+   *
+   * @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.
+   */
+
+  public double getArmVoltage() {
+    return intakeArm.get();
+  }
+
   /***
    * This method checks to see if the presence of the ball inside is true or
    * false.