Skip to content

Commit

Permalink
fixed controller bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
siyoyoCode committed Jan 26, 2024
1 parent 77243b3 commit e0675be
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,27 +80,37 @@ private void configureBindings() {
* B button - run feed wheels while button held
*/

aButton.onTrue(new LoadNoteCommand(feederSubsystem));
// aButton.onTrue(new LoadNoteCommand(feederSubsystem));

bButton.onTrue(new ShootNoteCommand(feederSubsystem));
// bButton.onTrue(new ShootNoteCommand(feederSubsystem));

leftBumper.onTrue(new AutoAimCommand(pivotSubsystem));
// leftBumper.onTrue(new AutoAimCommand(pivotSubsystem));

rightBumper.onTrue(new VerticalCommand(pivotSubsystem));
// rightBumper.onTrue(new VerticalCommand(pivotSubsystem));

xButton.onTrue(new ReadyShooterCommand(shooterSubsystem));
// xButton.onTrue(new ReadyShooterCommand(shooterSubsystem));

yButton.onTrue(new StopShooterCommands(shooterSubsystem));
// yButton.onTrue(new StopShooterCommands(shooterSubsystem));

shooterSubsystem.setDefaultCommand(new InstantCommand(() -> {
pivotSubsystem.setPivotMotorSpeed(-mechController.getLeftTriggerAxis());
aButton.onTrue(new InstantCommand(() -> {
shooterSubsystem.setShooterMotorSpeed(shooterSubsystem.SHOOTER_MOTOR_SPEED);
}));

shooterSubsystem.setDefaultCommand(new InstantCommand(() -> {
pivotSubsystem.setPivotMotorSpeed(mechController.getRightTriggerAxis());
aButton.onFalse(new InstantCommand(() -> {
shooterSubsystem.setShooterMotorSpeed(0);
}));

bButton.onTrue(new InstantCommand(() -> {
feederSubsystem.setFeederMotorSpeed(feederSubsystem.FEEDER_MOTOR_SPEED);
}));

bButton.onTrue(new InstantCommand(() -> {
feederSubsystem.setFeederMotorSpeed(0);
}));

pivotSubsystem.setDefaultCommand(new InstantCommand(() -> {
pivotSubsystem.setPivotMotorSpeed(mechController.getRightTriggerAxis() - mechController.getLeftTriggerAxis());
}));

if(baseSwerveSubsystem instanceof SwerveSubsystem){
final SwerveSubsystem swerveSubsystem = (SwerveSubsystem) baseSwerveSubsystem;
Expand Down

0 comments on commit e0675be

Please sign in to comment.