Add set motor speed methods in defense arm and add potentiometer getter methods
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / subsystems / Scaler.java
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
21 public void setPistonStatus(int status) {
22
23 }
24
25 public Value getSolenoidValue() {
26 return piston.get();
27 }
28
29 public void liftScissorLift() {
30 piston.set(DoubleSolenoid.Value.kReverse);
31 }
32
33 public void lowerScissorLift() {
34 piston.set(DoubleSolenoid.Value.kForward);
35 }
36
37 public void engageHook() {
38
39 }
40
41 public void disengageHook() {
42 }
43
44 public void runWinch(double speed) {
45 if (speed > 1)
46 speed = 1;
47 if (speed < -1)
48 speed = -1;
49
50 winch.set(speed);
51 }
52
53 @Override
54 protected void initDefaultCommand() {
55
56 }
57 }