Skip to content

Commit

Permalink
Add a slow button for shooting in the trough
Browse files Browse the repository at this point in the history
  • Loading branch information
LTeixeira4909 committed Jan 8, 2025
1 parent 786f31f commit d358c9a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ private void configureBindings() {
point.withModuleDirection(
new Rotation2d(-joystick.getLeftY(), -joystick.getLeftX()))));

joystick.x().whileTrue(s_Shooter.shoot()).onFalse(s_Shooter.stop());
joystick.x().whileTrue(s_Shooter.shootL2()).onFalse(s_Shooter.stop());
joystick.y().whileTrue(s_Shooter.intake()).onFalse(s_Shooter.stop());
joystick.a().whileTrue(s_Shooter.shootTrough()).onFalse(s_Shooter.stop());


// Run SysId routines when holding back/start and X/Y.
// Note that each routine should be run exactly once in a single log.
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/frc/robot/subsystems/shooter/Shooter.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ public class Shooter extends SubsystemBase {
private final ShooterIO m_io;

public Shooter(ShooterIO io) {
System.out.println("Constructor");
m_io = io;
}

public Command shoot() {
public Command shootL2() {
return this.run(() -> m_io.setSpeed(-0.3));
}

public Command shootTrough() {
return this.run(() -> m_io.setSpeed(-0.1));
}

public Command stop() {
return this.run(() -> m_io.setSpeed(0));
}
Expand Down

0 comments on commit d358c9a

Please sign in to comment.