REVLib - C++
rev::MotorFeedbackSensor Class Referenceabstract

#include <MotorFeedbackSensor.h>

Inherits rev::CANSensor.

Inherited by 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
 

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::SparkMaxAlternateEncoder, rev::SparkMaxAnalogSensor, rev::SparkMaxRelativeEncoder, rev::CANAnalog, rev::CANEncoder, and rev::RelativeEncoder.

◆ 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::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

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