From 02cde7ca58d1ee1e91e26ae548eb093cc356eab2 Mon Sep 17 00:00:00 2001 From: Rohan Rodrigues Date: Thu, 2 Mar 2017 16:38:25 -0800 Subject: [PATCH] Add code to alternate pistons in runIndexWheelContinuous --- src/org/usfirst/frc/team3501/robot/Constants.java | 5 +++++ .../robot/commands/shooter/RunIndexWheelContinuous.java | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/src/org/usfirst/frc/team3501/robot/Constants.java b/src/org/usfirst/frc/team3501/robot/Constants.java index c2fbf7b..9a80556 100644 --- a/src/org/usfirst/frc/team3501/robot/Constants.java +++ b/src/org/usfirst/frc/team3501/robot/Constants.java @@ -34,6 +34,11 @@ public class Constants { public static final int INDEX_WHEEL = 7; public final static int HALL_EFFECT_PORT = 9; + + public static final int PISTON_MODULE = 10, PISTON_FORWARD = 0, + PISTON_REVERSE = 1; + public static final Value HIGH_GEAR = DoubleSolenoid.Value.kForward; + public static final Value LOW_GEAR = DoubleSolenoid.Value.kReverse; } public static class DriveTrain { diff --git a/src/org/usfirst/frc/team3501/robot/commands/shooter/RunIndexWheelContinuous.java b/src/org/usfirst/frc/team3501/robot/commands/shooter/RunIndexWheelContinuous.java index 34c7e0b..31fda94 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/shooter/RunIndexWheelContinuous.java +++ b/src/org/usfirst/frc/team3501/robot/commands/shooter/RunIndexWheelContinuous.java @@ -1,5 +1,6 @@ package org.usfirst.frc.team3501.robot.commands.shooter; +import org.usfirst.frc.team3501.robot.Constants; import org.usfirst.frc.team3501.robot.Robot; import org.usfirst.frc.team3501.robot.subsystems.Shooter; @@ -41,6 +42,14 @@ public class RunIndexWheelContinuous extends Command { // Called repeatedly when this Command is scheduled to run @Override protected void execute() { + if (t.get() % 1 == 0) { + if (Shooter.getShooter().getPistonValue() == Constants.Shooter.LOW_GEAR) { + Shooter.getShooter().setHighGear(); + } else { + Shooter.getShooter().setLowGear(); + } + } + double shooterSpeed = shooter.getShooterRPM(); if (shooterSpeed > 0) shooter.runIndexWheel(); -- 2.30.2