From 6f581e053e0809cd72934b1e551dbb953d4efee3 Mon Sep 17 00:00:00 2001 From: cherriae Date: Mon, 11 Mar 2024 16:16:17 -0400 Subject: [PATCH] added through-bore encoder code for intake --- src/main/java/frc/robot/subsystems/IntakeSubsystem.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java index 4726e2d..667b1d0 100644 --- a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java @@ -4,6 +4,7 @@ import com.revrobotics.CANSparkLowLevel.MotorType; import com.revrobotics.CANSparkMax; import com.revrobotics.RelativeEncoder; +import com.revrobotics.SparkMaxAlternateEncoder; import com.revrobotics.CANSparkBase.SoftLimitDirection; import edu.wpi.first.math.MathUtil; @@ -53,7 +54,7 @@ public IntakeSubsystem() { _feedMotor = new CANSparkMax(Constants.CAN.INTAKE_FEED, MotorType.kBrushless); _actuatorMotor = new CANSparkMax(Constants.CAN.INTAKE_ACTUATOR, MotorType.kBrushless); - _actuatorEncoder = _actuatorMotor.getEncoder(); + _actuatorEncoder = _actuatorMotor.getAlternateEncoder(SparkMaxAlternateEncoder.Type.kQuadrature, 8192); _actuatorEncoder.setPosition(0); _feedEncoder = _feedMotor.getEncoder();