REVLib - C++
rev::MotorFeedbackSensor Class Referenceabstract

#include <MotorFeedbackSensor.h>

Inherits rev::CANSensor.

Inherited by rev::AbsoluteEncoder, rev::CANAnalog, and rev::CANEncoder.

Public Member Functions

virtual ~MotorFeedbackSensor ()
 
REVLibError SetInverted (bool inverted) override=0
 
bool GetInverted () const override=0
 
- Public Member Functions inherited from rev::CANSensor
virtual ~CANSensor ()
 

Friends

class CANAnalog
 
class CANEncoder
 
class AbsoluteEncoder
 

Detailed Description

A sensor that can be used to provide rotational feedback to a motor controller

Constructor & Destructor Documentation

◆ ~MotorFeedbackSensor()

virtual rev::MotorFeedbackSensor::~MotorFeedbackSensor ( )
inlinevirtual

Member Function Documentation

◆ SetInverted()

REVLibError rev::MotorFeedbackSensor::SetInverted ( bool  inverted)
overridepure virtual

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.

Parameters
invertedThe phase of the sensor
Returns
REVLibError::kOk if successful

Implements rev::CANSensor.

Implemented in rev::SparkFlexExternalEncoder, rev::SparkMaxAbsoluteEncoder, rev::SparkMaxAlternateEncoder, rev::SparkMaxAnalogSensor, rev::SparkMaxRelativeEncoder, rev::CANAnalog, rev::CANEncoder, rev::RelativeEncoder, and rev::AbsoluteEncoder.

◆ GetInverted()

bool rev::MotorFeedbackSensor::GetInverted ( ) const
overridepure virtual

Get the phase of the MotorFeedbackSensor. This will just return false if the user tries to get the inversion of the hall sensor.

Returns
The phase of the sensor

Implements rev::CANSensor.

Implemented in rev::AbsoluteEncoder, rev::SparkFlexExternalEncoder, rev::SparkMaxAbsoluteEncoder, rev::SparkMaxAlternateEncoder, rev::SparkMaxAnalogSensor, rev::SparkMaxRelativeEncoder, rev::CANAnalog, rev::CANEncoder, and rev::RelativeEncoder.

Friends And Related Function Documentation

◆ CANAnalog

friend class CANAnalog
friend

◆ CANEncoder

friend class CANEncoder
friend

◆ AbsoluteEncoder

friend class AbsoluteEncoder
friend

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