rename SetWinchSpeed to RunWinchContinuous and add new condition to end() to stop...
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / subsystems / Scaler.java
CommitLineData
31f6cd19 1package org.usfirst.frc.team3501.robot.subsystems;
15651225 2
31f6cd19
K
3import org.usfirst.frc.team3501.robot.Constants;
4
cb16c238 5import edu.wpi.first.wpilibj.CANTalon;
31f6cd19
K
6import edu.wpi.first.wpilibj.DoubleSolenoid;
7import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
8import edu.wpi.first.wpilibj.command.Subsystem;
9
10public class Scaler extends Subsystem {
15651225
K
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);
15651225
K
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 }
ae33aa8d 31
05fc6bf5 32 public void engageHook() {
ae33aa8d 33
05fc6bf5 34 }
15651225
K
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 }
ae33aa8d 47
4f1eb45e
SC
48 /***
49 * This method returns boolean value true or false on whether piston is
50 * extended or not.
8e57685f 51 *
60519772 52 * @return returns true if piston is extended, false if otherwise.
4f1eb45e
SC
53 */
54 public boolean getPistonStatus() {
55 return true;
56 }
57
58 /***
60519772
LM
59 * This method sets the piston status for the scissor lift. The piston can
60 * either be extended or not extended.
8e57685f 61 *
4f1eb45e 62 * @param status
60519772
LM
63 * The status of the piston. 0 for the piston to be extended, 1 for
64 * the piston to not be extended.
4f1eb45e
SC
65 */
66
67 public void setPistonStatus(int status) {
68
69 }
70
ae33aa8d
SC
71 @Override
72 protected void initDefaultCommand() {
73
74 }
31f6cd19 75}