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=3d49f90be48f17f96ef93f6a4c550030697265a2;hb=8275a069e1891bd27156dcd947a897519c42a3a3;hpb=7b3f27ebc4101105e1d54e1f7ae2f6e3f42fa2a8 diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/Climber.java b/src/org/usfirst/frc/team3501/robot/subsystems/Climber.java index 3d49f90..4cec792 100644 --- a/src/org/usfirst/frc/team3501/robot/subsystems/Climber.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/Climber.java @@ -1,17 +1,25 @@ package org.usfirst.frc.team3501.robot.subsystems; import org.usfirst.frc.team3501.robot.Constants; +import org.usfirst.frc.team3501.robot.MathLib; import com.ctre.CANTalon; import edu.wpi.first.wpilibj.command.Subsystem; public class Climber extends Subsystem { - private static Climber climber; - private final CANTalon motor; + public static Climber climber; - private Climber() { - motor = new CANTalon(Constants.Climber.MOTOR); + 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() { @@ -21,12 +29,19 @@ public class Climber extends Subsystem { return climber; } + public void setMotorValues(double climbingSpeed) { + winch.set(MathLib.limitValue(climbingSpeed, 0.0, 1.0)); + } + public void stop() { - setMotorValue(0); + winch.set(0); } - public void setMotorValue(final double val) { - motor.set(MOTOR); + public void setCANTalonsBrakeMode(boolean mode) { + winch.enableBrakeMode(mode); + } + @Override + protected void initDefaultCommand() { } }