From 5930d874bede4f9a0734fa113b4791b6910ef8ab Mon Sep 17 00:00:00 2001 From: Cindy Zhang Date: Wed, 17 Feb 2016 11:08:59 -0800 Subject: [PATCH] add second piston that controls hood, and change open/close values in constants --- src/org/usfirst/frc/team3501/robot/Constants.java | 4 ++-- .../frc/team3501/robot/subsystems/Shooter.java | 14 +++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/org/usfirst/frc/team3501/robot/Constants.java b/src/org/usfirst/frc/team3501/robot/Constants.java index 7ee2d3b2..4ad8a4bf 100644 --- a/src/org/usfirst/frc/team3501/robot/Constants.java +++ b/src/org/usfirst/frc/team3501/robot/Constants.java @@ -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; diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java b/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java index 43aea899..69bff0bd 100755 --- a/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java @@ -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; } -- 2.30.2