| 1 | package org.usfirst.frc.team3501.robot.subsystems; |
| 2 | |
| 3 | import org.usfirst.frc.team3501.robot.Constants; |
| 4 | |
| 5 | import edu.wpi.first.wpilibj.CANTalon; |
| 6 | import edu.wpi.first.wpilibj.DoubleSolenoid; |
| 7 | import edu.wpi.first.wpilibj.DoubleSolenoid.Value; |
| 8 | import edu.wpi.first.wpilibj.command.Subsystem; |
| 9 | |
| 10 | public class Scaler extends Subsystem { |
| 11 | private DoubleSolenoid piston; |
| 12 | private CANTalon winch; |
| 13 | |
| 14 | public Scaler() { |
| 15 | piston = new DoubleSolenoid(Constants.Scaler.FORWARD_CHANNEL, |
| 16 | Constants.Scaler.REVERSE_CHANNEL); |
| 17 | winch = new CANTalon(Constants.Scaler.WINCH_MOTOR); |
| 18 | } |
| 19 | |
| 20 | public Value getSolenoidValue() { |
| 21 | return piston.get(); |
| 22 | } |
| 23 | |
| 24 | public void liftScissorLift() { |
| 25 | piston.set(DoubleSolenoid.Value.kReverse); |
| 26 | } |
| 27 | |
| 28 | public void lowerScissorLift() { |
| 29 | piston.set(DoubleSolenoid.Value.kForward); |
| 30 | } |
| 31 | |
| 32 | public void engageHook() { |
| 33 | |
| 34 | } |
| 35 | |
| 36 | public void disengageHook() { |
| 37 | } |
| 38 | |
| 39 | public void runWinch(double speed) { |
| 40 | if (speed > 1) |
| 41 | speed = 1; |
| 42 | if (speed < -1) |
| 43 | speed = -1; |
| 44 | |
| 45 | winch.set(speed); |
| 46 | } |
| 47 | |
| 48 | /*** |
| 49 | * This method returns boolean value true or false on whether piston is |
| 50 | * extended or not. |
| 51 | * |
| 52 | * @return |
| 53 | * returns true if piston is extended, false if otherwise. |
| 54 | */ |
| 55 | public boolean getPistonStatus() { |
| 56 | return true; |
| 57 | } |
| 58 | |
| 59 | /*** |
| 60 | * This method sets the motor voltage for the scissor lift. The range is from |
| 61 | * [-1, 1]. |
| 62 | * |
| 63 | * @param speed |
| 64 | * The voltage that you set the motor at. The range of the voltage of |
| 65 | * the motor is from [-1,1]. |
| 66 | */ |
| 67 | public void setScalarSpeed(double speed) { |
| 68 | |
| 69 | } |
| 70 | |
| 71 | /*** |
| 72 | * This method sets the piston status for the scissor lift. |
| 73 | * The piston can either be extended or not extended. |
| 74 | * |
| 75 | * @param status |
| 76 | * The status of the piston. |
| 77 | * 0 for the piston to be extended, 1 for the piston to not be |
| 78 | * extended. |
| 79 | */ |
| 80 | |
| 81 | public void setPistonStatus(int status) { |
| 82 | |
| 83 | } |
| 84 | |
| 85 | @Override |
| 86 | protected void initDefaultCommand() { |
| 87 | |
| 88 | } |
| 89 | } |