Interface RelativeEncoder
- All Known Implementing Classes:
DetachedEncoder, SparkFlexExternalEncoder, SparkMaxAlternateEncoder, SparkRelativeEncoder, SplineEncoder
public interface RelativeEncoder
Get an instance of this interface by using
SparkBase.getEncoder(), SparkMax.getAlternateEncoder(), or SparkFlex.getExternalEncoder().-
Method Summary
Modifier and TypeMethodDescriptionGet the position of the motor.Get the velocity of the motor.setPosition(double position) Set the position of the encoder.
-
Method Details
-
getPosition
-
getVelocity
-
setPosition
Set the position of the encoder. By default the units are 'rotations'.- Parameters:
position- Number of rotations of the motor- Returns:
REVLibError.kOkif successful
-