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

Commit 43b73f9

Browse files
authored
Changed Some Values to Constants (#50)
1 parent c154702 commit 43b73f9

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
/** Add your docs here. */
88
public class Constants {
99
public static class constDrivetrain {
10-
10+
public static final double SLOW_MODE_MULTIPLIER = 0.5;
1111
}
1212
}

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.revrobotics.CANSparkLowLevel.MotorType;
99

1010
import edu.wpi.first.wpilibj2.command.SubsystemBase;
11+
import frc.robot.Constants;
1112
import frc.robot.RobotMap;
1213

1314
public class Drivetrain extends SubsystemBase {
@@ -36,8 +37,8 @@ public Drivetrain() {
3637
public void setDrivetrainSpeed(double forwardVelocity, double rotationSpeed, boolean slowModeActivated) {
3738
// Divide speed in half if slow mode is activated
3839
if (slowModeActivated) {
39-
forwardVelocity = forwardVelocity * 0.5;
40-
rotationSpeed = rotationSpeed * 0.5;
40+
forwardVelocity = forwardVelocity * Constants.constDrivetrain.SLOW_MODE_MULTIPLIER;
41+
rotationSpeed = rotationSpeed * Constants.constDrivetrain.SLOW_MODE_MULTIPLIER;
4142
}
4243

4344
// Set right velocity

0 commit comments

Comments
 (0)