Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
Created faster drivetrain speed button (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
KaneBarnes authored Mar 24, 2022
1 parent 17837a1 commit b9cc0a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/frc/robot/RobotPreferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public static final class DrivetrainPrefs {
public static final SN_DoublePreference arcadeSpeed = new SN_DoublePreference("arcadeSpeed", 0.65);
public static final SN_DoublePreference arcadeTurn = new SN_DoublePreference("arcadeTurn", .5);
public static final SN_DoublePreference arcadeLowSpeed = new SN_DoublePreference("arcadeLowSpeed", 0.4);
public static final SN_DoublePreference arcadeHighSpeed = new SN_DoublePreference("arcadeHighSpeed", 1.5);

public static final SN_DoublePreference driveF = new SN_DoublePreference("driveF", 0);
public static final SN_DoublePreference driveP = new SN_DoublePreference("driveP", 1);
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/frc/robot/subsystems/Drivetrain.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ public void arcadeDrive(double a_speed, double a_turn) {
multiplier = RobotPreferences.DrivetrainPrefs.arcadeLowSpeed.getValue();
}

if (RobotContainer.DriverStick.btn_RBump.get()) {
multiplier = RobotPreferences.DrivetrainPrefs.arcadeHighSpeed.getValue();
}

leftLeadMotor.set(ControlMode.PercentOutput, speed * multiplier, DemandType.ArbitraryFeedForward, turn);
rightLeadMotor.set(ControlMode.PercentOutput, speed * multiplier, DemandType.ArbitraryFeedForward, -turn);
}
Expand Down

0 comments on commit b9cc0a5

Please sign in to comment.