X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fsubsystems%2FIntake.java;h=b6c82d484f5f56b03dac38dd6332496972937910;hb=refs%2Fheads%2Fmaster;hp=17ff8fe22413a4e1507644b89a42bc2d4eb203b2;hpb=5868b2cf3f43c0b3dd63cac19fa49ca2b2c0571d;p=3501%2F2017steamworks diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/Intake.java b/src/org/usfirst/frc/team3501/robot/subsystems/Intake.java index 17ff8fe..b6c82d4 100644 --- a/src/org/usfirst/frc/team3501/robot/subsystems/Intake.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/Intake.java @@ -1,6 +1,7 @@ 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; @@ -12,8 +13,8 @@ import edu.wpi.first.wpilibj.command.Subsystem; public class Intake extends Subsystem { private static Intake intake = null; private CANTalon intakeWheel; - public static final double INTAKE_SPEED = 0; - public static final double REVERSE_SPEED = 0; + public static final double INTAKE_SPEED = 1; + public static final double REVERSE_SPEED = -1; public Intake() { intakeWheel = new CANTalon(Constants.Intake.INTAKE_ROLLER_PORT); @@ -43,7 +44,8 @@ public class Intake extends Subsystem { * @param speed * from -1 to 1 */ - private void setSpeed(double speed) { + public void setSpeed(double speed) { + speed = MathLib.restrictToRange(speed, -1.0, 1.0); intakeWheel.set(speed); } @@ -66,7 +68,7 @@ public class Intake extends Subsystem { * the robot. Reverses intake wheel by setting wheel speed to reverse speed. * */ - public void reverseIntake() { + public void runReverseIntake() { setSpeed(REVERSE_SPEED); }