From: Your Name Date: Sat, 23 Jan 2016 23:12:51 +0000 (-0800) Subject: add defense arm values corresponding with potentiometer degree values X-Git-Url: http://challenge-bot.com/repos/?a=commitdiff_plain;h=90784ff27e4537d327bbf9f04ff76eec0434bf42;p=3501%2Fstronghold-2016 add defense arm values corresponding with potentiometer degree values --- diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/DefenseArm.java b/src/org/usfirst/frc/team3501/robot/subsystems/DefenseArm.java index e4a875d3..776e8ac1 100755 --- a/src/org/usfirst/frc/team3501/robot/subsystems/DefenseArm.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/DefenseArm.java @@ -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.