REVLib - C++
rev::AnalogInput Class Referenceabstract

#include <AnalogInput.h>

Inherited by rev::SparkMaxAnalogSensor.

Public Member Functions

virtual ~AnalogInput ()
 
virtual double GetVoltage () const =0
 
virtual double GetPosition () const =0
 
virtual REVLibError SetPositionConversionFactor (double factor)=0
 
virtual double GetPositionConversionFactor () const =0
 

Friends

class SparkMaxAnalogSensor
 

Detailed Description

Constructor & Destructor Documentation

◆ ~AnalogInput()

virtual rev::AnalogInput::~AnalogInput ( )
inlinevirtual

Member Function Documentation

◆ GetVoltage()

virtual double rev::AnalogInput::GetVoltage ( ) const
pure virtual

Get the voltage of the analog sensor.

Returns
Voltage of the sensor

Implemented in rev::SparkMaxAnalogSensor.

◆ GetPosition()

virtual double rev::AnalogInput::GetPosition ( ) const
pure virtual

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

Implemented in rev::SparkMaxAnalogSensor.

◆ SetPositionConversionFactor()

virtual REVLibError rev::AnalogInput::SetPositionConversionFactor ( double  factor)
pure virtual

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
factorThe conversion factor which will be multiplied by volts
Returns
REVLibError::kOk if successful

Implemented in rev::SparkMaxAnalogSensor.

◆ GetPositionConversionFactor()

virtual double rev::AnalogInput::GetPositionConversionFactor ( ) const
pure virtual

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

Returns
Analog position conversion factor

Implemented in rev::SparkMaxAnalogSensor.

Friends And Related Function Documentation

◆ SparkMaxAnalogSensor

friend class SparkMaxAnalogSensor
friend

The documentation for this class was generated from the following file: