continue to flesh out initial codebase
[3501/3501-spark-go] / src / org / usfirst / frc / team3501 / robot / subsystems / Arm.java
index deffbdda123f11183b0a9d5a72944d394c1e9b94..8cfcf9b6411a646b9caaa78aae909fda25292964 100644 (file)
@@ -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() {}
 }