AnalogInput

class rev.AnalogInput

Bases: pybind11_object

Get an instance of AnalogInput by using CANSparkBase::GetAnalog(SparkMaxAnalogSensor::Mode)}.

getPosition() float

Get the position of the motor. 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

getPositionConversionFactor() float

Get the current conversion factor for the position of the analog sensor.

Returns:

Analog position conversion factor

getVoltage() float

Get the voltage of the analog sensor.

Returns:

Voltage of the sensor

setPositionConversionFactor(factor: float) rev._rev.REVLibError

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