Commit | Line | Data |
---|---|---|
a0c3ca74 KZ |
1 | package org.usfirst.frc.team3501.robot.subsystems; |
2 | ||
3 | import org.usfirst.frc.team3501.robot.Constants; | |
a0c3ca74 | 4 | |
9b10474d | 5 | import edu.wpi.first.wpilibj.DoubleSolenoid; |
fee6b62e | 6 | import edu.wpi.first.wpilibj.DoubleSolenoid.Value; |
a0c3ca74 KZ |
7 | import edu.wpi.first.wpilibj.command.Subsystem; |
8 | ||
27fac8ed | 9 | /*** |
3b2038bb ME |
10 | * The Shooter consists of a platform and wheel, each controlled by separate |
11 | * motors. The piston controlling the platform pushes the ball onto the wheel. | |
12 | * The wheel is controlled by a motor, which is running before the ball is | |
13 | * pushed onto the wheel. The spinning wheel propels the ball. | |
fee6b62e | 14 | * |
27fac8ed | 15 | * @author superuser |
fee6b62e | 16 | * |
27fac8ed YA |
17 | */ |
18 | ||
a0c3ca74 | 19 | public class Shooter extends Subsystem { |
e4fbab02 | 20 | private DoubleSolenoid catapult1, catapult2; |
a0c3ca74 KZ |
21 | |
22 | public Shooter() { | |
e4fbab02 HD |
23 | catapult1 = new DoubleSolenoid(Constants.Shooter.CATAPULT1_MODULE, |
24 | Constants.Shooter.CATAPULT1_FORWARD, | |
25 | Constants.Shooter.CATAPULT1_REVERSE); | |
26 | catapult2 = new DoubleSolenoid(Constants.Shooter.CATAPULT2_MODULE, | |
27 | Constants.Shooter.CATAPULT2_FORWARD, | |
28 | Constants.Shooter.CATAPULT2_REVERSE); | |
4b29730e E |
29 | } |
30 | ||
e4fbab02 HD |
31 | // Catapult Commands |
32 | public void fireCatapult() { | |
7988f380 HD |
33 | catapult1.set(Constants.Shooter.SHOOT); |
34 | catapult2.set(Constants.Shooter.SHOOT); | |
a0c3ca74 KZ |
35 | } |
36 | ||
3082b809 | 37 | // Retracts catapult pistons |
e4fbab02 | 38 | public void resetCatapult() { |
7988f380 HD |
39 | catapult1.set(Constants.Shooter.RESET); |
40 | catapult2.set(Constants.Shooter.RESET); | |
cc72c5b2 CZ |
41 | } |
42 | ||
fee6b62e ME |
43 | public Value getCatapult1State() { |
44 | return catapult1.get(); | |
45 | } | |
46 | ||
47 | public Value getCatapult2State() { | |
48 | return catapult2.get(); | |
49 | } | |
50 | ||
3b2038bb ME |
51 | @Override |
52 | protected void initDefaultCommand() { | |
071ab315 | 53 | } |
a0c3ca74 | 54 | } |