Interface CANAnalog

All Superinterfaces:
CANSensor, MotorFeedbackSensor
All Known Implementing Classes:
SparkMaxAnalogSensor

@Deprecated(forRemoval=true) public interface CANAnalog extends MotorFeedbackSensor
Deprecated, for removal: This API element is subject to removal in a future version.
use AnalogInput instead (or SparkMaxAnalogSensor if the analog sensor is connected directly to a SPARK MAX)
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the phase of the MotorFeedbackSensor.
    double
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the position of the sensor.
    double
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the current conversion factor for the position of the analog sensor.
    double
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the velocity of the sensor.
    double
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the current conversion factor for the velocity of the analog sensor.
    double
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the voltage of the analog sensor.
    setInverted(boolean inverted)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set the phase of the MotorFeedbackSensor so that it is set to be in phase with the motor itself.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set the conversion factor for the position of the analog sensor.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set the conversion factor for the velocity of the analog sensor.
  • Method Details

    • getVoltage

      double getVoltage()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the voltage of the analog sensor.
      Returns:
      Voltage of the sensor.
    • getPosition

      double getPosition()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the position of the sensor. Returns value in the native unit of 'volt' by default, and can be changed by a scale factor using setPositionConversionFactor().
      Returns:
      Position of the sensor in volts
    • getVelocity

      double getVelocity()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the velocity of the sensor. Returns value in the native units of 'volts per second' by default, and can be changed by a scale factor using setVelocityConversionFactor().
      Returns:
      Velocity of the sensor in volts per second
    • setPositionConversionFactor

      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the conversion factor for the position of the analog sensor. By default, revolutions per volt is 1. Changing the position conversion factor will also change the position units.
      Parameters:
      factor - The conversion factor which will be multiplied by volts
      Returns:
      REVLibError.kOk if successful
    • setVelocityConversionFactor

      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the conversion factor for the velocity of the analog sensor. By default, revolutions per volt second is 1. Changing the velocity conversion factor will also change the velocity units.
      Parameters:
      factor - The conversion factor which will be multiplied by volts per second
      Returns:
      REVLibError.kOk if successful
    • getPositionConversionFactor

      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the current conversion factor for the position of the analog sensor.
      Returns:
      Analog position conversion factor
    • getVelocityConversionFactor

      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the current conversion factor for the velocity of the analog sensor.
      Returns:
      Analog velocity conversion factor
    • setInverted

      REVLibError setInverted(boolean inverted)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MotorFeedbackSensor
      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
      Specified by:
      setInverted in interface MotorFeedbackSensor
      Parameters:
      inverted - The phase of the sensor
      Returns:
      REVLibError.kOk if successful
    • getInverted

      boolean getInverted()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MotorFeedbackSensor
      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
      Specified by:
      getInverted in interface MotorFeedbackSensor
      Returns:
      The phase of the sensor