X-Git-Url: http://challenge-bot.com/repos/?p=3501%2F2017steamworks;a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fsubsystems%2FClimber.java;h=4cec792e1e937aa37e91282823c99e730369894c;hp=87407950e5cb83d9c6ece2ddce6f22f0467cb804;hb=8275a069e1891bd27156dcd947a897519c42a3a3;hpb=dbf2ff8fd7ae4dc5a1e3a490c47e12380500e8ff diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/Climber.java b/src/org/usfirst/frc/team3501/robot/subsystems/Climber.java index 8740795..4cec792 100644 --- a/src/org/usfirst/frc/team3501/robot/subsystems/Climber.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/Climber.java @@ -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() { + } }