Commit | Line | Data |
---|---|---|
31f6cd19 | 1 | package org.usfirst.frc.team3501.robot.subsystems; |
15651225 | 2 | |
31f6cd19 K |
3 | import org.usfirst.frc.team3501.robot.Constants; |
4 | ||
cb16c238 | 5 | import edu.wpi.first.wpilibj.CANTalon; |
31f6cd19 K |
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 { | |
cef820ab | 11 | private DoubleSolenoid scaler; |
15651225 K |
12 | private CANTalon winch; |
13 | ||
14 | public Scaler() { | |
b3bdd589 | 15 | scaler = new DoubleSolenoid(9, Constants.Scaler.FORWARD_CHANNEL, |
15651225 K |
16 | Constants.Scaler.REVERSE_CHANNEL); |
17 | winch = new CANTalon(Constants.Scaler.WINCH_MOTOR); | |
15651225 K |
18 | } |
19 | ||
20 | public Value getSolenoidValue() { | |
cef820ab | 21 | return scaler.get(); |
15651225 K |
22 | } |
23 | ||
24 | public void liftScissorLift() { | |
cef820ab | 25 | scaler.set(DoubleSolenoid.Value.kReverse); |
15651225 K |
26 | } |
27 | ||
28 | public void lowerScissorLift() { | |
cef820ab | 29 | scaler.set(DoubleSolenoid.Value.kForward); |
15651225 K |
30 | } |
31 | ||
32 | public void runWinch(double speed) { | |
33 | if (speed > 1) | |
34 | speed = 1; | |
35 | if (speed < -1) | |
36 | speed = -1; | |
37 | ||
38 | winch.set(speed); | |
39 | } | |
ae33aa8d | 40 | |
694c9fc9 LM |
41 | public void stopWinch() { |
42 | runWinch(Constants.Scaler.WINCH_STOP_SPEED); | |
43 | } | |
44 | ||
ae33aa8d SC |
45 | @Override |
46 | protected void initDefaultCommand() { | |
47 | ||
48 | } | |
31f6cd19 | 49 | } |