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=da11cb45e400f7e6802e67a0d1177d664009ecd0;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 8d305998..5461efc6 100755 --- a/src/org/usfirst/frc/team3501/robot/subsystems/DefenseArm.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/DefenseArm.java @@ -1,16 +1,40 @@ package org.usfirst.frc.team3501.robot.subsystems; +import org.usfirst.frc.team3501.robot.Constants; + import edu.wpi.first.wpilibj.AnalogPotentiometer; import edu.wpi.first.wpilibj.command.Subsystem; public class DefenseArm extends Subsystem { // Defense arm related objects private AnalogPotentiometer potentiometer; + // Defense arm specific constants that relate to the degrees per pulse value // for the potentiometers - private final static double PULSES_PER_ROTATION = 0; // in pulses + private final static double PULSES_PER_ROTATION = 1; // in pulses private final static double FULL_RANGE = 270.0; // in degrees private final static double OFFSET = -135.0; // in degrees + private Double[] potentiometerArray; // change name, 5 to another # + + public DefenseArm() { + potentiometer = new AnalogPotentiometer(Constants.DefenseArm.CHANNEL, + FULL_RANGE, OFFSET); + } + + public double getDistance(int desiredArmLocation) { + return potentiometerArray[desiredArmLocation]; + } + + public Double[] putInValues() { + for (int i = 0; i < 3; i++) { + potentiometerArray[i] = (double) (45 * i); + } + return potentiometerArray; + } + + public void moveArmTo() { + + } @Override protected void initDefaultCommand() {