-
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
95d8d37
commit df70ae3
Showing
3 changed files
with
51 additions
and
6 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
44 changes: 44 additions & 0 deletions
44
src/main/java/org/jmhsrobotics/frc2024/subsystems/intake/commands/AutoIntakeCommand.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,44 @@ | ||
package org.jmhsrobotics.frc2024.subsystems.intake.commands; | ||
|
||
import org.jmhsrobotics.frc2024.subsystems.intake.IntakeSubsystem; | ||
import org.jmhsrobotics.frc2024.subsystems.shooter.ShooterSubsystem; | ||
|
||
import edu.wpi.first.wpilibj2.command.Command; | ||
|
||
public class AutoIntakeCommand extends Command { | ||
|
||
private IntakeSubsystem intakeSubsystem; | ||
private ShooterSubsystem shooterSubsystem; | ||
|
||
private double speed; | ||
|
||
public AutoIntakeCommand(double speed, IntakeSubsystem intakeSubsystem, ShooterSubsystem shooterSubsystem) { | ||
this.speed = speed; | ||
this.intakeSubsystem = intakeSubsystem; | ||
this.shooterSubsystem = shooterSubsystem; | ||
|
||
addRequirements(this.intakeSubsystem); | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
this.intakeSubsystem.set(0); | ||
} | ||
|
||
@Override | ||
public void execute() { | ||
this.intakeSubsystem.set(this.speed); | ||
this.shooterSubsystem.setSpeed(-.05); | ||
} | ||
|
||
@Override | ||
public boolean isFinished() { | ||
return this.intakeSubsystem.hasNote(); | ||
// return false; | ||
} | ||
|
||
@Override | ||
public void end(boolean interrupted) { | ||
this.intakeSubsystem.set(0); | ||
} | ||
} |