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=f16f424bf6e05ad5927476ab311bbf28944078e1;hpb=b608371909aac65293e5722dd0ed144d95a7fd67;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 f16f424b..3c47a476 100755 --- a/src/org/usfirst/frc/team3501/robot/subsystems/Scaler.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/Scaler.java @@ -1,4 +1,5 @@ package org.usfirst.frc.team3501.robot.subsystems; + import org.usfirst.frc.team3501.robot.Constants; import edu.wpi.first.wpilibj.CANTalon; @@ -7,41 +8,82 @@ 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; - private CANTalon winch; - - public Scaler() { - piston = new DoubleSolenoid(Constants.Scaler.FORWARD_CHANNEL, Constants.Scaler.REVERSE_CHANNEL); - winch = new CANTalon(Constants.Scaler.WINCH_MOTOR); - } - - @Override - protected void initDefaultCommand() { - - } - - public Value getSolenoidValue(){ - return piston.get(); - } - - public void liftScissorLift(){ - piston.set(DoubleSolenoid.Value.kReverse); - } - - public void lowerScissorLift(){ - piston.set(DoubleSolenoid.Value.kForward); - } - - public void disengageHook(){ - } - - public void runWinch(double speed){ - if( speed > 1) - speed = 1; - if(speed < -1) - speed = -1; - - winch.set(speed); - } + 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() { + + } }