PicoLowLevel
Loading...
Searching...
No Matches
TractionEncoder Class Reference

Class used to read data from traction rotary encoders. More...

#include <TractionEncoder.h>

Public Member Functions

 TractionEncoder (byte pin_a, byte pin_b, Filter< int > *filter=NULL, bool invert=false, PIO pio=pio0)
 Creates object.
 
void begin ()
 Sets the encoder's pins and attach the interrupt.
 
int getSpeed ()
 Returns the last detected speed.
 
int getSteps ()
 Returns the number of steps since the class was initialized.
 

Detailed Description

Class used to read data from traction rotary encoders.

Constructor & Destructor Documentation

◆ TractionEncoder()

TractionEncoder::TractionEncoder ( byte  pin_a,
byte  pin_b,
Filter< int > *  filter = NULL,
bool  invert = false,
PIO  pio = pio0 
)

Creates object.

Parameters
pin_aPin A of the encoder.
pin_bPin B of the encoder.
filterFilter to apply to the encoder's output. NULL if no filter is needed.
invertInvert the encoder's output.
pioPIO to use. Each PIO can handle up to 4 encoders.

Member Function Documentation

◆ begin()

void TractionEncoder::begin ( )

Sets the encoder's pins and attach the interrupt.

Here is the caller graph for this function:

◆ getSpeed()

int TractionEncoder::getSpeed ( )

Returns the last detected speed.

Returns
The speed in centiRPMs.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSteps()

int TractionEncoder::getSteps ( )

Returns the number of steps since the class was initialized.

Returns
The number of steps.
Here is the caller graph for this function:

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