add defense arm values corresponding with potentiometer degree values
authorYour Name <garima.kapila369@gmail.com>
Sat, 23 Jan 2016 23:12:51 +0000 (15:12 -0800)
committerShaina Chen <shaina.sierra@gmail.com>
Fri, 5 Feb 2016 04:21:02 +0000 (20:21 -0800)
src/org/usfirst/frc/team3501/robot/subsystems/DefenseArm.java

index e4a875d368d1b72acd86f055c05f4830bdce2ed3..776e8ac190f1f2168818639e8fc4c424a761ca74 100755 (executable)
@@ -14,8 +14,7 @@ public class DefenseArm extends Subsystem {
   private CANTalon defenseHand;
   private double hookHeight;
   private double footHeight;
-  private double[] potAngles = { 0, 45, 90 };
-
+  private Double[] potAngles; // change name, 5 to another #
   // array;
 
   public DefenseArm() {
@@ -36,6 +35,17 @@ public class DefenseArm extends Subsystem {
     return defenseHandPotentiometer.get();
   }
 
+  public double getDistance(int desiredArmLocation) {
+    return potAngles[desiredArmLocation];
+  }
+
+  public Double[] putInValues() {
+    for (int i = 0; i < 3; i++) {
+      potAngles[i] = (double) (45 * i);
+    }
+    return potAngles;
+  }
+
   /***
    * 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.