From: Rohan Rodrigues Date: Fri, 3 Mar 2017 00:38:25 +0000 (-0800) Subject: Add code to alternate pistons in runIndexWheelContinuous X-Git-Url: http://challenge-bot.com/repos/?p=3501%2F2017steamworks;a=commitdiff_plain;h=02cde7ca58d1ee1e91e26ae548eb093cc356eab2 Add code to alternate pistons in runIndexWheelContinuous --- 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();