Interface AnalogInput

    • Method Detail

      • getVoltage

        double getVoltage()
        Get the voltage of the analog sensor.
        Returns:
        Voltage of the sensor.
      • getPosition

        double getPosition()
        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
      • setPositionConversionFactor

        REVLibError setPositionConversionFactor​(double factor)
        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
      • getPositionConversionFactor

        double getPositionConversionFactor()
        Get the current conversion factor for the position of the analog sensor.
        Returns:
        Analog position conversion factor