Skip to content
This repository was archived by the owner on Jul 20, 2025. It is now read-only.

Commit 8948ebb

Browse files
authored
Added Deadzone (#61)
* Added Deadzone * Changed Dead Zone Logic Thanks for the suggestion bro bro * Added Deadband to Right Thumbstick bro right stick sucks bro
1 parent 2a05c4d commit 8948ebb

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/main/java/frc/robot/Constants.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66

77
/** Add your docs here. */
88
public class Constants {
9-
public static class constDrivetrain {
10-
public static final double SLOW_MODE_MULTIPLIER = 0.5;
11-
}
9+
public static class constDrivetrain {
10+
public static final double SLOW_MODE_MULTIPLIER = 0.5;
11+
public static final double CONTROLLER_DEADZONE = 0.2;
12+
}
1213

1314
public static class constIntake {
1415
public static final double INTAKE_EJECT_VELOCITY = -0.5;

src/main/java/frc/robot/RobotContainer.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ public class RobotContainer {
3939

4040
public RobotContainer() {
4141
subDrivetrain.setDefaultCommand(com_Drive);
42+
m_driverController.setLeftDeadband(Constants.constDrivetrain.CONTROLLER_DEADZONE);
43+
m_driverController.setRightDeadband(Constants.constDrivetrain.CONTROLLER_DEADZONE);
4244
configureBindings();
4345
}
44-
46+
4547
private void configureBindings() {
4648
m_driverController.btn_B.whileTrue(com_IntakeGround);
4749
m_driverController.btn_X.whileTrue(com_PrepShooter);

src/main/java/frc/robot/subsystems/Drivetrain.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public Drivetrain() {
3636
*/
3737
public void setDrivetrainSpeed(double forwardVelocity, double rotationSpeed, boolean slowModeActivated) {
3838
// Divide speed in half if slow mode is activated
39+
3940
if (slowModeActivated) {
4041
forwardVelocity = forwardVelocity * Constants.constDrivetrain.SLOW_MODE_MULTIPLIER;
4142
rotationSpeed = rotationSpeed * Constants.constDrivetrain.SLOW_MODE_MULTIPLIER;

0 commit comments

Comments
 (0)