From 2f2aa761f9eaf4bbabd7389850573a096bf01685 Mon Sep 17 00:00:00 2001 From: Shaina Chen Date: Thu, 4 Feb 2016 20:12:48 -0800 Subject: [PATCH] add setArmVoltage and getArmVoltage methods --- .../team3501/robot/subsystems/IntakeArm.java | 35 ++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/IntakeArm.java b/src/org/usfirst/frc/team3501/robot/subsystems/IntakeArm.java index 3fa5d3e9..7140b83e 100755 --- a/src/org/usfirst/frc/team3501/robot/subsystems/IntakeArm.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/IntakeArm.java @@ -50,7 +50,7 @@ public class IntakeArm extends Subsystem { /*** * This method gets you the current voltage of the motor that controls the - * intake arm. The range of voltage is from [-1,1]. + * intake arm roller. The range of voltage is from [-1,1]. * A negative voltage makes the motor run backwards. * * @return Returns the voltage of the motor that controls the roller. The @@ -62,6 +62,39 @@ public class IntakeArm extends Subsystem { return intakeRoller.get(); } + /*** + * 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. + * + * @param voltage + * The voltage that you set the motor at. The range of the voltage of + * the arm motor is from [-1,1]. A + * negative voltage makes the direction of the motor go backwards. + */ + + public void setArmVoltage(double voltage) { + if (voltage > 1) + voltage = 1; + else if (voltage < -1) + voltage = -1; + + intakeArm.set(voltage); + } + + /*** + * This method gets you the current voltage of the motor that controls the + * intake arm. The range of voltage is from [-1,1]. + * A negative voltage makes the motor run backwards. + * + * @return Returns the voltage of the motor that controls the arm. The + * range of the voltage goes from [-1,1]. + * A negative voltage indicates that the motor is running backwards. + */ + + public double getArmVoltage() { + return intakeArm.get(); + } + /*** * This method checks to see if the presence of the ball inside is true or * false. -- 2.30.2