Skip to content

Commit

Permalink
added adjust shooter angle button
Browse files Browse the repository at this point in the history
  • Loading branch information
cherriae committed Apr 6, 2024
1 parent 8515564 commit 7c7feb8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ private void configureBindings() {
)
);

_operatorController.povDown().whileTrue(new SetShooter(_shooterSubsystem, _shooterSubsystem::adjustedAngle));

// driver bindings
_driveController.L1().onTrue(Commands.runOnce(_swerveSubsystem::toggleSpeed, _swerveSubsystem));
_driveController.R1().onTrue(Commands.runOnce(() -> _swerveSubsystem.fieldOriented = !_swerveSubsystem.fieldOriented, _swerveSubsystem));
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/frc/robot/subsystems/ShooterSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public class ShooterSubsystem extends SubsystemBase {
private final Timer _revTimer = new Timer();

private double _shooterTrim = 0;
private double _shooterAdjust = 0;

private boolean _holdNote = false;

Expand Down Expand Up @@ -94,6 +95,7 @@ public ShooterSubsystem() {
_angleController.setTolerance(2.5);

SmartDashboard.putNumber("SHOOTER TRIM", _shooterTrim);
SmartDashboard.putNumber("SHOOTER ADJUST", _shooterAdjust);
}

@Override
Expand All @@ -110,6 +112,14 @@ public void periodic() {
SmartDashboard.putBoolean("SHOOTER REVVED", isRevved());

_shooterTrim = SmartDashboard.getNumber("SHOOTER TRIM", _shooterTrim);
_shooterAdjust = SmartDashboard.getNumber("SHOOTER ADJUST", _shooterAdjust);
}

/**
* Returns the adjusted shooter angle.
*/
public double adjustedAngle() {
return getAngle() + _shooterAdjust;
}

// for resetting the shooter's angle
Expand Down

0 comments on commit 7c7feb8

Please sign in to comment.