add second piston that controls hood, and change open/close values in constants
authorCindy Zhang <cindyzyx9@gmail.com>
Wed, 17 Feb 2016 19:08:59 +0000 (11:08 -0800)
committerCindy Zhang <cindyzyx9@gmail.com>
Wed, 17 Feb 2016 19:08:59 +0000 (11:08 -0800)
src/org/usfirst/frc/team3501/robot/Constants.java
src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java

index 7ee2d3b29e2b6e378fc0277d6d785109580794ac..4ad8a4bf0be8bb5ded68e636dd9c2ee2910a2ec2 100644 (file)
@@ -112,8 +112,8 @@ public class Constants {
     public static final int HOOD_FORWARD = 2;
     public static final int HOOD_REVERSE = 3;
 
-    public static final Value open = Value.kForward;
-    public static final Value closed = Value.kReverse;
+    public static final Value open = Value.kReverse;
+    public static final Value closed = Value.kForward;
 
     public static final Port LIDAR_I2C_PORT = I2C.Port.kMXP;
 
index 43aea8990254a242bdcc97d8b4f12d9c746005ca..69bff0bda6ca9475560fa93853f245dbdeeea05b 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,15 +95,17 @@ 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 (hood.get() == Constants.Shooter.open)
+    if (hood1.get() == Constants.Shooter.open)
       return true;
     return false;
   }