X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fsubsystems%2FArm.java;h=8cfcf9b6411a646b9caaa78aae909fda25292964;hb=3e4790a8551e2a7c20db705dea86cb59f3c84696;hp=deffbdda123f11183b0a9d5a72944d394c1e9b94;hpb=b449387d8a410c4d224b9ebca4cbe6b6689ff26b;p=ozzloy%40gmail.com%2F3501-spark-go diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/Arm.java b/src/org/usfirst/frc/team3501/robot/subsystems/Arm.java index deffbdd..8cfcf9b 100644 --- a/src/org/usfirst/frc/team3501/robot/subsystems/Arm.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/Arm.java @@ -1,18 +1,41 @@ package org.usfirst.frc.team3501.robot.subsystems; +import org.usfirst.frc.team3501.robot.RobotMap; + +import edu.wpi.first.wpilibj.CANJaguar; import edu.wpi.first.wpilibj.command.Subsystem; -/** - * - */ public class Arm extends Subsystem { - - // Put methods for controlling this subsystem - // here. Call these from Commands. - public void initDefaultCommand() { - // Set the default command for a subsystem here. - //setDefaultCommand(new MySpecialCommand()); + private CANJaguar left, right; + + public Arm() { + left = new CANJaguar(RobotMap.LEFT_WINCH_ADDRESS); + right = new CANJaguar(RobotMap.RIGHT_WINCH_ADDRESS); + } + + public void set(double speed) { + left.set(-speed); + right.set(speed); + } + + public void moveLeft(double speed) { + left.set(speed); + right.set(0); } + + public void moveRight(double speed) { + right.set(speed); + left.set(0); + } + + public double getSpeedFromJoystick(double speed) { + if (Math.abs(speed) < RobotMap.MIN_ARM_JOYSTICK_INPUT) + speed = 0; + + return speed; + } + + public void initDefaultCommand() {} }