Saved
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / subsystems / Climber.java
index 87407950e5cb83d9c6ece2ddce6f22f0467cb804..4cec792e1e937aa37e91282823c99e730369894c 100644 (file)
@@ -1,10 +1,25 @@
 package org.usfirst.frc.team3501.robot.subsystems;
 
-public class Climber {
-  private static Climber climber;
+import org.usfirst.frc.team3501.robot.Constants;
+import org.usfirst.frc.team3501.robot.MathLib;
 
-  private Climber() {
+import com.ctre.CANTalon;
 
+import edu.wpi.first.wpilibj.command.Subsystem;
+
+public class Climber extends Subsystem {
+  public static Climber climber;
+
+  public static final boolean BRAKE_MODE = true;
+  public static final boolean COAST_MODE = false;
+
+  public static final double CLIMBER_SPEED = 1.0;
+  public boolean shouldBeClimbing = true;
+
+  private CANTalon winch;
+
+  public Climber() {
+    winch = new CANTalon(Constants.Climber.WINCH_PORT);
   }
 
   public static Climber getClimber() {
@@ -13,4 +28,20 @@ public class Climber {
     }
     return climber;
   }
+
+  public void setMotorValues(double climbingSpeed) {
+    winch.set(MathLib.limitValue(climbingSpeed, 0.0, 1.0));
+  }
+
+  public void stop() {
+    winch.set(0);
+  }
+
+  public void setCANTalonsBrakeMode(boolean mode) {
+    winch.enableBrakeMode(mode);
+  }
+
+  @Override
+  protected void initDefaultCommand() {
+  }
 }