1 package org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
;
3 import org
.usfirst
.frc
.team3501
.robot
.Robot
;
5 import edu
.wpi
.first
.wpilibj
.Timer
;
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
{
16 private double motorVal
;
20 * See JavaDoc comment in class for details
23 * value range from -1 to 1
25 * in seconds, amount of time to run fly wheel motor
27 public RunFlyWheel(double motorVal
, double time
) {
28 requires(Robot
.getShooter());
31 this.motorVal
= motorVal
;
35 // Called just before this Command runs the first time
37 protected void initialize() {
39 Robot
.getShooter().setFlyWheelMotorVal(motorVal
);
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 Robot
.getShooter().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
;