The title explains the topic. I need an equivalent function of getPeriod() of the Encoder class for CANEncoder class.
CANSparkMax.getEncoder().getVelocity();
is the equivalent of the wpilib Encoder classes .getRate() method (getPeriod() has been deprecated in favor of getRate()).
Ok thank you. I’ll try it right away
Keep in mind that CANSparkMax.getEncoder().getVelocity()
returns the speed in RPM while Encoder.getRate()
returns distance per second as scaled by the value from Encoder.setDistancePerPulse()
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.