REVLib - C++
rev::spark::SparkMaxAlternateEncoder Class Reference

#include <SparkMaxAlternateEncoder.h>

Inherits rev::RelativeEncoder.

Public Member Functions

 SparkMaxAlternateEncoder (SparkMaxAlternateEncoder &&rhs)=default
 
SparkMaxAlternateEncoderoperator= (SparkMaxAlternateEncoder &&rhs)=default
 
 SparkMaxAlternateEncoder (const SparkMaxAlternateEncoder &rhs)=default
 
 ~SparkMaxAlternateEncoder () override=default
 
double GetPosition () const override
 
double GetVelocity () const override
 
REVLibError SetPosition (double position) override
 
- Public Member Functions inherited from rev::RelativeEncoder
virtual ~RelativeEncoder ()
 

Friends

class SparkMax
 

Detailed Description

Get an instance of this class by using SparkMax::GetEncoder() or SparkMax::GetEncoder(SparkMax::EncoderType, int).

Constructor & Destructor Documentation

◆ SparkMaxAlternateEncoder() [1/2]

rev::spark::SparkMaxAlternateEncoder::SparkMaxAlternateEncoder ( SparkMaxAlternateEncoder &&  rhs)
default

◆ SparkMaxAlternateEncoder() [2/2]

rev::spark::SparkMaxAlternateEncoder::SparkMaxAlternateEncoder ( const SparkMaxAlternateEncoder rhs)
default

◆ ~SparkMaxAlternateEncoder()

rev::spark::SparkMaxAlternateEncoder::~SparkMaxAlternateEncoder ( )
overridedefault

Member Function Documentation

◆ operator=()

SparkMaxAlternateEncoder & rev::spark::SparkMaxAlternateEncoder::operator= ( SparkMaxAlternateEncoder &&  rhs)
default

◆ GetPosition()

double SparkMaxAlternateEncoder::GetPosition ( ) const
overridevirtual

Get the position of the motor. This returns the native units of 'rotations' by default, and can be changed by a scale factor using setPositionConversionFactor().

Returns
Number of rotations of the motor

Implements rev::RelativeEncoder.

◆ GetVelocity()

double SparkMaxAlternateEncoder::GetVelocity ( ) const
overridevirtual

Get the velocity of the motor. This returns the native units of 'RPM' by default, and can be changed by a scale factor using setVelocityConversionFactor().

Returns
Number the RPM of the motor

Implements rev::RelativeEncoder.

◆ SetPosition()

rev::REVLibError SparkMaxAlternateEncoder::SetPosition ( double  position)
overridevirtual

Set the position of the encoder.

Parameters
positionNumber of rotations of the motor
Returns
REVLibError::kOk if successful

Implements rev::RelativeEncoder.

Friends And Related Function Documentation

◆ SparkMax

friend class SparkMax
friend

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