our team uses victor spx motor controllers and during comp we used one borrowed talon so we could use an encoder, we decided to use one of our 2 sample spark maxes we have saved to replace the talon and used the same vex mag encoder with the CTRE encoder housing. i copied all the robot.java code from the example code for an alternate encoder given here by rev, but when it comes to implementing the encoder data into our arm’s limit i keep getting the fatal problem
Type mismatch: cannot convert from RelativeEncoder to double on return m_motor.getAlternateEncoder(4096)
You have to initiate the encoder object RelativeEncoder, we do it in the constructor. Currently, you are comparing the encoder object to a double causing the error. In your getter, you should be returning a double to compare against, using getPosition() or getVelocity().