add second piston that controls hood to isHoodDown method
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / subsystems / Shooter.java
index f547ab0ee84fa2ae9399eb75898534218615ba07..3633c04ca10e2fea9e5c63a656427a86642eaea1 100755 (executable)
@@ -21,13 +21,15 @@ import edu.wpi.first.wpilibj.command.Subsystem;
 
 public class Shooter extends Subsystem {
   private CANTalon shooter;
-  private DoubleSolenoid hood, punch;
+  private DoubleSolenoid hood1, hood2, punch;
   private Encoder encoder;
   private Lidar lidar;
 
   public Shooter() {
     shooter = new CANTalon(Constants.Shooter.PORT);
-    hood = new DoubleSolenoid(Constants.Shooter.HOOD_FORWARD,
+    hood1 = new DoubleSolenoid(Constants.Shooter.HOOD_FORWARD,
+        Constants.Shooter.HOOD_REVERSE);
+    hood2 = new DoubleSolenoid(Constants.Shooter.HOOD_FORWARD,
         Constants.Shooter.HOOD_REVERSE);
     punch = new DoubleSolenoid(Constants.Shooter.PUNCH_FORWARD,
         Constants.Shooter.PUNCH_REVERSE);
@@ -93,11 +95,20 @@ public class Shooter extends Subsystem {
   }
 
   public void raiseHood() {
-    hood.set(Constants.Shooter.open);
+    hood1.set(Constants.Shooter.open);
+    hood2.set(Constants.Shooter.open);
   }
 
   public void lowerHood() {
-    hood.set(Constants.Shooter.closed);
+    hood1.set(Constants.Shooter.closed);
+    hood2.set(Constants.Shooter.closed);
+  }
+
+  public boolean isHoodDown() {
+    if (hood1.get() == Constants.Shooter.open
+        && hood2.get() == Constants.Shooter.open)
+      return true;
+    return false;
   }
 
   @Override