X-Git-Url: http://challenge-bot.com/repos/?p=3501%2F2017steamworks;a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fcommands%2Fdriving%2FToggleGearManipulatorPiston.java;fp=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fcommands%2Fdriving%2FToggleGearManipulatorPiston.java;h=eed7f14e29619bba9be3c723f08450d4c209693c;hp=0000000000000000000000000000000000000000;hb=fc01fb0fb74d31a0818c69d0306253deb4236c58;hpb=cb8e86cb498c12dcf4e2b7a5916fc6f4926b77cf diff --git a/src/org/usfirst/frc/team3501/robot/commands/driving/ToggleGearManipulatorPiston.java b/src/org/usfirst/frc/team3501/robot/commands/driving/ToggleGearManipulatorPiston.java new file mode 100644 index 0000000..eed7f14 --- /dev/null +++ b/src/org/usfirst/frc/team3501/robot/commands/driving/ToggleGearManipulatorPiston.java @@ -0,0 +1,49 @@ +package org.usfirst.frc.team3501.robot.commands.driving; + +import org.usfirst.frc.team3501.robot.Constants; +import org.usfirst.frc.team3501.robot.Robot; +import org.usfirst.frc.team3501.robot.subsystems.DriveTrain; + +import edu.wpi.first.wpilibj.DoubleSolenoid.Value; +import edu.wpi.first.wpilibj.command.Command; + +/** + * + */ +public class ToggleGearManipulatorPiston extends Command { + private DriveTrain driveTrain = Robot.getDriveTrain(); + + public ToggleGearManipulatorPiston() { + } + + @Override + protected void initialize() { + Value gearPistonValue = driveTrain.getGearManipulatorPistonValue(); + if (gearPistonValue == Constants.DriveTrain.REVERSE_PISTON_VALUE) { + driveTrain.extendGearManipulatorPiston(); + } else { + driveTrain.retractGearManipulatorPiston(); + } + } + + @Override + protected void execute() { + } + + // Make this return true when this Command no longer needs to run execute() + @Override + protected boolean isFinished() { + return true; + } + + // Called once after isFinished returns true + @Override + protected void end() { + } + + // Called when another command which requires one or more of the same + // subsystems is scheduled to run + @Override + protected void interrupted() { + } +}