X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fsubsystems%2FScaler.java;h=3c47a4764fd9c7cf401f0e16002981783bed6b35;hb=8e57685f4bacaa8353202309b93bd8f7802e0631;hp=97c2e955957aaefac7b8b9964a888ac1477cc537;hpb=804d3b6a139821df41db07e5cd2c513355ac7547;p=3501%2Fstronghold-2016 diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/Scaler.java b/src/org/usfirst/frc/team3501/robot/subsystems/Scaler.java index 97c2e955..3c47a476 100755 --- a/src/org/usfirst/frc/team3501/robot/subsystems/Scaler.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/Scaler.java @@ -1,41 +1,89 @@ -package org.usfirst.frc.team3501.robot.subsystems; -import org.usfirst.frc.team3501.robot.Constants; - -import edu.wpi.first.wpilibj.DoubleSolenoid; -import edu.wpi.first.wpilibj.DoubleSolenoid.Value; -import edu.wpi.first.wpilibj.command.Subsystem; - -public class Scaler extends Subsystem { - //Scaler related objects - private DoubleSolenoid piston; - - - public Scaler() { - piston = new DoubleSolenoid(Constants.Scaler.FORWARD_CHANNEL, Constants.Scaler.REVERSE_CHANNEL); - } - - @Override - protected void initDefaultCommand() { - - } - public Value getSolenoidValue(){ - return piston.get(); - } - - public void lift(){ - piston.set(DoubleSolenoid.Value.kReverse); - } - - public void lower(){ - piston.set(DoubleSolenoid.Value.kForward); - } - - public void disengageHook(){ - - } - - public void runWinch(){ - - } - -} +package org.usfirst.frc.team3501.robot.subsystems; + +import org.usfirst.frc.team3501.robot.Constants; + +import edu.wpi.first.wpilibj.CANTalon; +import edu.wpi.first.wpilibj.DoubleSolenoid; +import edu.wpi.first.wpilibj.DoubleSolenoid.Value; +import edu.wpi.first.wpilibj.command.Subsystem; + +public class Scaler extends Subsystem { + private DoubleSolenoid piston; + private CANTalon winch; + + public Scaler() { + piston = new DoubleSolenoid(Constants.Scaler.FORWARD_CHANNEL, + Constants.Scaler.REVERSE_CHANNEL); + winch = new CANTalon(Constants.Scaler.WINCH_MOTOR); + } + + public Value getSolenoidValue() { + return piston.get(); + } + + public void liftScissorLift() { + piston.set(DoubleSolenoid.Value.kReverse); + } + + public void lowerScissorLift() { + piston.set(DoubleSolenoid.Value.kForward); + } + + public void engageHook() { + + } + + public void disengageHook() { + } + + public void runWinch(double speed) { + if (speed > 1) + speed = 1; + if (speed < -1) + speed = -1; + + winch.set(speed); + } + + /*** + * This method returns boolean value true or false on whether piston is + * extended or not. + * + * @return + * returns true if piston is extended, false if otherwise. + */ + public boolean getPistonStatus() { + return true; + } + + /*** + * This method sets the motor voltage for the scissor lift. The range is from + * [-1, 1]. + * + * @param speed + * The voltage that you set the motor at. The range of the voltage of + * the motor is from [-1,1]. + */ + public void setScalarSpeed(double speed) { + + } + + /*** + * This method sets the piston status for the scissor lift. + * The piston can either be extended or not extended. + * + * @param status + * The status of the piston. + * 0 for the piston to be extended, 1 for the piston to not be + * extended. + */ + + public void setPistonStatus(int status) { + + } + + @Override + protected void initDefaultCommand() { + + } +}