1 package org
.usfirst
.frc
.team3501
.robot
.subsystems
;
3 import org
.usfirst
.frc
.team3501
.robot
.Constants
;
5 import edu
.wpi
.first
.wpilibj
.AnalogPotentiometer
;
6 import edu
.wpi
.first
.wpilibj
.CANTalon
;
7 import edu
.wpi
.first
.wpilibj
.command
.Subsystem
;
9 public class DefenseArm
extends Subsystem
{
10 // Defense arm related objects
11 private AnalogPotentiometer defenseArmPotentiometer
;
12 private AnalogPotentiometer defenseHandPotentiometer
;
13 private CANTalon defenseArm
;
14 private CANTalon defenseHand
;
15 private double hookHeight
;
16 private double footHeight
;
17 private double[] potAngles
= { 0, 45, 90 };
22 defenseArmPotentiometer
= new AnalogPotentiometer(
23 Constants
.DefenseArm
.ARM_CHANNEL
,
24 Constants
.DefenseArm
.FULL_RANGE
,
25 Constants
.DefenseArm
.OFFSET
);
27 defenseArm
= new CANTalon(Constants
.DefenseArm
.ARM_PORT
);
28 defenseHand
= new CANTalon(Constants
.DefenseArm
.HAND_PORT
);
31 public double getArmPotAngle() {
32 return defenseArmPotentiometer
.get();
35 public double getHandPotAngle() {
36 return defenseHandPotentiometer
.get();
40 * This method sets the voltage of the arm motor. The range is from [-1,1]. A
41 * negative voltage makes the direction of the motor go backwards.
44 * The voltage that you set the motor at. The range of the voltage of
45 * the arm motor is from [-1,1]. A
46 * negative voltage makes the direction of the motor go backwards.
49 public void setArmSpeed(double speed
) {
55 defenseArm
.set(speed
);
59 * This method sets the voltage of the hand motor. The range is from [-1,1]. A
60 * negative voltage makes the direction of the motor go backwards.
63 * The voltage that you set the motor at. The range of the voltage of
64 * the hand motor is from [-1,1]. A
65 * negative voltage makes the direction of the motor go backwards.
68 public void setHandSpeed(double speed
) {
74 defenseHand
.set(speed
);
78 protected void initDefaultCommand() {