implement tank drive and toggle winch
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / subsystems / Climber.java
CommitLineData
150f450f
CZ
1package org.usfirst.frc.team3501.robot.subsystems;
2
3import org.usfirst.frc.team3501.robot.Constants;
4import org.usfirst.frc.team3501.robot.MathLib;
150f450f
CZ
5
6import com.ctre.CANTalon;
7
8import edu.wpi.first.wpilibj.command.Subsystem;
9
10public class Climber extends Subsystem {
11 public static Climber climber;
12
13 public static final boolean BRAKE_MODE = true;
14 public static final boolean COAST_MODE = false;
15
ba9f0b12
CZ
16 public static final double CLIMBER_SPEED = 1.0;
17 public boolean shouldBeClimbing = false;
150f450f
CZ
18
19 private CANTalon winch;
20
21 public Climber() {
22 winch = new CANTalon(Constants.Climber.WINCH_PORT);
23 }
24
25 public static Climber getClimber() {
26 if (climber == null) {
27 climber = new Climber();
28 }
29 return climber;
30 }
31
32 public void setMotorValues(double climbingSpeed) {
33 winch.set(MathLib.limitValue(climbingSpeed, 0.0, 1.0));
34 }
35
36 public void stop() {
37 winch.set(0);
38 }
39
40 public void setCANTalonsBrakeMode(boolean mode) {
41 winch.enableBrakeMode(mode);
42 }
43
44 @Override
45 protected void initDefaultCommand() {
150f450f
CZ
46 }
47}