Interface MotorFeedbackSensor

All Superinterfaces:
CANSensor
All Known Subinterfaces:
CANAnalog, CANEncoder, RelativeEncoder
All Known Implementing Classes:
SparkMaxAlternateEncoder, SparkMaxAnalogSensor, SparkMaxRelativeEncoder

public interface MotorFeedbackSensor extends CANSensor
A sensor that can be used to provide rotational feedback to a motor controller
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Get the phase of the MotorFeedbackSensor.
    setInverted(boolean inverted)
    Set the phase of the MotorFeedbackSensor so that it is set to be in phase with the motor itself.
  • Method Details

    • setInverted

      REVLibError setInverted(boolean inverted)
      Set the phase of the MotorFeedbackSensor so that it is set to be in phase with the motor itself. This only works for quadrature encoders and analog sensors. This will throw an error if the user tries to set the inversion of the hall sensor.
      Specified by:
      setInverted in interface CANSensor
      Parameters:
      inverted - The phase of the sensor
      Returns:
      REVLibError.kOk if successful
    • getInverted

      boolean getInverted()
      Get the phase of the MotorFeedbackSensor. This will just return false if the user tries to get the inversion of the hall sensor.
      Specified by:
      getInverted in interface CANSensor
      Returns:
      The phase of the sensor