use wait command and move if statements from shoot at high goal to resetcatapult
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / subsystems / Shooter.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.DoubleSolenoid;
6 import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
7 import edu.wpi.first.wpilibj.command.Subsystem;
8
9 /***
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.
14 *
15 * @author superuser
16 *
17 */
18
19 public class Shooter extends Subsystem {
20 private DoubleSolenoid catapult1, catapult2;
21
22 public Shooter() {
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);
29 }
30
31 // Catapult Commands
32 public void fireCatapult() {
33 catapult1.set(Constants.Shooter.SHOOT);
34 catapult2.set(Constants.Shooter.SHOOT);
35 }
36
37 // Retracts catapult pistons
38 public void resetCatapult() {
39 catapult1.set(Constants.Shooter.RESET);
40 catapult2.set(Constants.Shooter.RESET);
41 }
42
43 public Value getCatapult1State() {
44 return catapult1.get();
45 }
46
47 public Value getCatapult2State() {
48 return catapult2.get();
49 }
50
51 @Override
52 protected void initDefaultCommand() {
53 }
54 }