ad13cc0084e38bb7f23284c4660850a9bea752e9
1 package org
.usfirst
.frc
.team3501
.robot
.commands
.driving
;
3 import org
.usfirst
.frc
.team3501
.robot
.Constants
;
4 import org
.usfirst
.frc
.team3501
.robot
.Robot
;
5 import org
.usfirst
.frc
.team3501
.robot
.subsystems
.DriveTrain
;
6 import edu
.wpi
.first
.wpilibj
.command
.Command
;
8 public class ToggleDrivePiston
extends Command
{
9 private DriveTrain driveTrain
= Robot
.getDriveTrain();
12 * See JavaDoc comment in class for details
15 * value range from -1 to 1
17 public ToggleDrivePiston() {
21 // Called just before this Command runs the first time
23 protected void initialize() {
26 // Called repeatedly when this Command is scheduled to run
28 protected void execute() {
29 if (DriveTrain
.getDriveTrain()
30 .getLeftGearPistonValue() == Constants
.DriveTrain
.HIGH_GEAR
) {
31 DriveTrain
.getDriveTrain().setLowGear();
33 DriveTrain
.getDriveTrain().setHighGear();
36 // check to make sure that both pistons are set to the same gear. Otherwise,
37 // the code must be changed
40 // Called once after isFinished returns true
42 protected void end() {
45 // Called when another command which requires one or more of the same
46 // subsystems is scheduled to run
48 protected void interrupted() {
53 protected boolean isFinished() {