From: Rohan Rodrigues Date: Sat, 4 Mar 2017 20:12:56 +0000 (-0800) Subject: Add code to toggle agitator pistons in RunIndexWheelContinuous X-Git-Url: http://challenge-bot.com/repos/?p=3501%2F2017steamworks;a=commitdiff_plain;h=2d810c3cff74251a39ae4899f3e87bfe982e0702 Add code to toggle agitator pistons in RunIndexWheelContinuous --- diff --git a/src/org/usfirst/frc/team3501/robot/Robot.java b/src/org/usfirst/frc/team3501/robot/Robot.java index 455de4e..e72f07e 100644 --- a/src/org/usfirst/frc/team3501/robot/Robot.java +++ b/src/org/usfirst/frc/team3501/robot/Robot.java @@ -55,8 +55,7 @@ public class Robot extends IterativeRobot { // both set to high gear @Override public void autonomousInit() { - driveTrain.setHighGear(driveTrain.getRightPiston()); - driveTrain.setHighGear(driveTrain.getLeftPiston()); + driveTrain.setHighGear(); } @Override 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 ab46b3f..e86f3ee 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/shooter/RunIndexWheelContinuous.java +++ b/src/org/usfirst/frc/team3501/robot/commands/shooter/RunIndexWheelContinuous.java @@ -1,8 +1,8 @@ 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; - import edu.wpi.first.wpilibj.Timer; import edu.wpi.first.wpilibj.command.Command; @@ -30,23 +30,26 @@ public class RunIndexWheelContinuous extends Command { */ public RunIndexWheelContinuous() { requires(shooter); - // t.start(); } // Called just before this Command runs the first time @Override protected void initialize() { - t.reset(); + t.start(); } // Called repeatedly when this Command is scheduled to run @Override protected void execute() { - /* - * if (t.get() >= 4) { if (Shooter.getShooter().getPistonValue() == - * Constants.Shooter.LOW_GEAR) { Shooter.getShooter().setHighGear(); } else - * { Shooter.getShooter().setLowGear(); } } - */ + + if (t.get() >= 1) { + if (Shooter.getShooter().getPistonValue() == Constants.Shooter.LOW_GEAR) { + Shooter.getShooter().setHighGear(); + } else { + Shooter.getShooter().setLowGear(); + } + t.reset(); + } double shooterSpeed = shooter.getShooterRPM(); if (shooterSpeed > 0)