| 1 | package org.usfirst.frc.team3501.robot.subsystems;\r |
| 2 | \r |
| 3 | import org.usfirst.frc.team3501.robot.Constants;\r |
| 4 | \r |
| 5 | import edu.wpi.first.wpilibj.AnalogPotentiometer;\r |
| 6 | import edu.wpi.first.wpilibj.CANTalon;\r |
| 7 | import edu.wpi.first.wpilibj.command.Subsystem;\r |
| 8 | \r |
| 9 | public class DefenseArm extends Subsystem {\r |
| 10 | // Defense arm related objects\r |
| 11 | private AnalogPotentiometer potentiometer;\r |
| 12 | private CANTalon defenseArmMotor;\r |
| 13 | \r |
| 14 | // Defense arm specific constants that relate to the degrees per pulse value\r |
| 15 | // for the potentiometers\r |
| 16 | private final static double PULSES_PER_ROTATION = 1; // in pulses\r |
| 17 | private final static double FULL_RANGE = 270.0; // in degrees\r |
| 18 | private final static double OFFSET = -135.0; // in degrees\r |
| 19 | private Double[] levelsToDegrees = { 0.0, 45.0, 90.0 }; // 3 level array;\r |
| 20 | // angles at 0,45,90\r |
| 21 | // degrees\r |
| 22 | \r |
| 23 | public DefenseArm() {\r |
| 24 | potentiometer = new AnalogPotentiometer(Constants.DefenseArm.CHANNEL,\r |
| 25 | FULL_RANGE, OFFSET);\r |
| 26 | }\r |
| 27 | \r |
| 28 | public double getDistance(int desiredArmLocation) {\r |
| 29 | return levelsToDegrees[desiredArmLocation];\r |
| 30 | }\r |
| 31 | \r |
| 32 | public void moveArmTo() {\r |
| 33 | \r |
| 34 | }\r |
| 35 | \r |
| 36 | @Override\r |
| 37 | protected void initDefaultCommand() {\r |
| 38 | }\r |
| 39 | }\r |