6ac5d69f3e1934c557adde63add9c5a72d4c5982
1 package org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
;
3 import org
.usfirst
.frc
.team3501
.robot
.Robot
;
4 import org
.usfirst
.frc
.team3501
.robot
.subsystems
.Shooter
;
6 import edu
.wpi
.first
.wpilibj
.command
.Command
;
9 * This command runs the fly wheel at a given speed for a given time. The fly
10 * wheel is intended to shoot balls fed by the intake wheel.
14 public class RunFlyWheel
extends Command
{
15 private Shooter shooter
= Robot
.getShooter();
19 * See JavaDoc comment in class for details
22 * value range from -1 to 1
24 * in seconds, amount of time to run fly wheel motor
26 public RunFlyWheel(double time
) {
31 // Called just before this Command runs the first time
33 protected void initialize() {
36 // Called repeatedly when this Command is scheduled to run
38 protected void execute() {
39 shooter
.setFlyWheelMotorVal(shooter
.CURRENT_SHOOTING_SPEED
);
42 // Called once after isFinished returns true
44 protected void end() {
45 shooter
.stopFlyWheel();
48 // Called when another command which requires one or more of the same
49 // subsystems is scheduled to run
51 protected void interrupted() {
56 protected boolean isFinished() {
57 return timeSinceInitialized() >= time
;