Interface SparkMaxAnalogSensor

    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      boolean getInverted()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the phase of the analog sensor
      double getPosition()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the position of the sensor.
      double 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.
      double getVelocity()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the velocity of the sensor.
      double 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.
      double getVoltage()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the voltage of the analog sensor.
      REVLibError setInverted​(boolean inverted)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the phase of the anlog sensor so that it is set to be in phase with the motor itself
      REVLibError setPositionConversionFactor​(double factor)
      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.
      REVLibError setVelocityConversionFactor​(double factor)
      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 Detail

      • getVoltage

        double getVoltage()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Get the voltage of the analog sensor.
        Specified by:
        getVoltage in interface AnalogInput
        Specified by:
        getVoltage in interface CANAnalog
        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().
        Specified by:
        getPosition in interface AnalogInput
        Specified by:
        getPosition in interface CANAnalog
        Returns:
        Position of the sensor
      • 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().
        Specified by:
        getVelocity in interface CANAnalog
        Returns:
        Velocity of the sensor in volts per second
      • setPositionConversionFactor

        REVLibError setPositionConversionFactor​(double factor)
        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.
        Specified by:
        setPositionConversionFactor in interface AnalogInput
        Specified by:
        setPositionConversionFactor in interface CANAnalog
        Parameters:
        factor - The conversion factor which will be multiplied by volts
        Returns:
        REVLibError.kOk if successful
      • setVelocityConversionFactor

        REVLibError setVelocityConversionFactor​(double factor)
        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.
        Specified by:
        setVelocityConversionFactor in interface CANAnalog
        Parameters:
        factor - The conversion factor which will be multiplied by volts per second
        Returns:
        REVLibError.kOk if successful
      • getPositionConversionFactor

        double 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.
        Specified by:
        getPositionConversionFactor in interface AnalogInput
        Specified by:
        getPositionConversionFactor in interface CANAnalog
        Returns:
        Analog position conversion factor
      • getVelocityConversionFactor

        double 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.
        Specified by:
        getVelocityConversionFactor in interface CANAnalog
        Returns:
        Analog velocity conversion factor
      • setInverted

        REVLibError setInverted​(boolean inverted)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Set the phase of the anlog sensor so that it is set to be in phase with the motor itself
        Specified by:
        setInverted in interface CANAnalog
        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.
        Get the phase of the analog sensor
        Specified by:
        getInverted in interface CANAnalog
        Specified by:
        getInverted in interface CANSensor
        Specified by:
        getInverted in interface MotorFeedbackSensor
        Returns:
        The phase of the sensor