f16f424bf6e05ad5927476ab311bbf28944078e1
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / subsystems / Scaler.java
1 package org.usfirst.frc.team3501.robot.subsystems;
2 import org.usfirst.frc.team3501.robot.Constants;
3
4 import edu.wpi.first.wpilibj.CANTalon;
5 import edu.wpi.first.wpilibj.DoubleSolenoid;
6 import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
7 import edu.wpi.first.wpilibj.command.Subsystem;
8
9 public class Scaler extends Subsystem {
10 //Scaler related objects
11 private DoubleSolenoid piston;
12 private CANTalon winch;
13
14 public Scaler() {
15 piston = new DoubleSolenoid(Constants.Scaler.FORWARD_CHANNEL, Constants.Scaler.REVERSE_CHANNEL);
16 winch = new CANTalon(Constants.Scaler.WINCH_MOTOR);
17 }
18
19 @Override
20 protected void initDefaultCommand() {
21
22 }
23
24 public Value getSolenoidValue(){
25 return piston.get();
26 }
27
28 public void liftScissorLift(){
29 piston.set(DoubleSolenoid.Value.kReverse);
30 }
31
32 public void lowerScissorLift(){
33 piston.set(DoubleSolenoid.Value.kForward);
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 }