-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7530bb7
commit ac164ad
Showing
10 changed files
with
87 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/frc/robot/commands/SpinFlywheelShooterForTime.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package frc.robot.commands; | ||
|
||
import edu.wpi.first.math.util.Units; | ||
import edu.wpi.first.wpilibj2.command.Command; | ||
import frc.robot.subsystems.intake.IntakeShooter; | ||
|
||
public class SpinFlywheelShooterForTime extends Command { | ||
private final IntakeShooter intakeShooter; | ||
private final double speed; | ||
private final double millisToWait; | ||
|
||
public SpinFlywheelShooterForTime(IntakeShooter intakeShooter, double speed, double seconds) { | ||
this.intakeShooter = intakeShooter; | ||
this.speed = speed; | ||
this.millisToWait = Units.secondsToMilliseconds(seconds); | ||
|
||
addRequirements(intakeShooter); | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
intakeShooter.setFlyWheelShooterSpeed(speed); | ||
} | ||
|
||
@Override | ||
public boolean isFinished() { | ||
return intakeShooter.howLongAtSpeedMillis(speed) > millisToWait; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters