diff --git a/src/main/java/frc/team2412/robot/subsystems/IntakeSubsystem.java b/src/main/java/frc/team2412/robot/subsystems/IntakeSubsystem.java index 6426a8ba..ba4b6d19 100644 --- a/src/main/java/frc/team2412/robot/subsystems/IntakeSubsystem.java +++ b/src/main/java/frc/team2412/robot/subsystems/IntakeSubsystem.java @@ -101,14 +101,22 @@ public IntakeSubsystem() { initShuffleboard(); } - private void configureMotor(CANSparkBase motor, int currentLimit, boolean invert) { + private void configureMotor( + CANSparkBase motor, int currentLimit, boolean invert, boolean enableLimitSwitch) { motor.restoreFactoryDefaults(); motor.setIdleMode(IdleMode.kBrake); motor.setSmartCurrentLimit(currentLimit); motor.setInverted(invert); + motor + .getForwardLimitSwitch(com.revrobotics.SparkLimitSwitch.Type.kNormallyOpen) + .enableLimitSwitch(enableLimitSwitch); motor.burnFlash(); } + private void configureMotor(CANSparkBase motor, int currentLimit, boolean invert) { + configureMotor(motor, currentLimit, invert, false); + } + private void configureMotor(CANSparkBase motor, boolean invert) { configureMotor(motor, 20, invert); } @@ -122,10 +130,8 @@ private void resetMotors() { configureMotor(ingestMotor, false); configureMotor(indexMotorUpper, 40, false); - configureMotor(feederMotor, 40, false); - indexMotorUpper - .getForwardLimitSwitch(com.revrobotics.SparkLimitSwitch.Type.kNormallyOpen) - .enableLimitSwitch(false); + configureMotor(feederMotor, 40, true); + indexMotorUpper.burnFlash(); }