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
.Timer
;
7 import edu
.wpi
.first
.wpilibj
.command
.Command
;
10 * This command runs the fly wheel at a given speed for a given time. The fly
11 * wheel is intended to shoot balls fed by the intake wheel.
15 public class RunFlyWheel
extends Command
{
16 private Shooter shooter
= Robot
.getShooter();
21 * See JavaDoc comment in class for details
24 * value range from -1 to 1
26 * in seconds, amount of time to run fly wheel motor
28 public RunFlyWheel(double time
) {
35 // Called just before this Command runs the first time
37 protected void initialize() {
39 shooter
.setFlyWheelMotorVal(shooter
.CURRENT_SHOOTING_SPEED
);
42 // Called repeatedly when this Command is scheduled to run
44 protected void execute() {
47 // Called once after isFinished returns true
49 protected void end() {
50 shooter
.stopFlyWheel();
53 // Called when another command which requires one or more of the same
54 // subsystems is scheduled to run
56 protected void interrupted() {
61 protected boolean isFinished() {
62 return timer
.get() >= time
;