|
SimpleFOClibrary
2.1
|
Go to the documentation of this file.
5 #include "../common/foc_utils.h"
6 #include "../common/time_utils.h"
7 #include "../common/base_classes/Sensor.h"
27 Encoder(
int encA,
int encB ,
float ppr,
int index = 0);
40 void enableInterrupts(
void (*doA)() =
nullptr,
void(*doB)() =
nullptr,
void(*doIndex)() =
nullptr);
76 volatile long pulse_counter;
77 volatile long pulse_timestamp;
78 volatile int A_active;
79 volatile int B_active;
80 volatile int I_active;
81 volatile bool index_found =
false;
84 float prev_Th, pulse_per_second;
85 volatile long prev_pulse_counter, prev_timestamp_us;
int pinA
encoder hardware pin A
Encoder(int encA, int encB, float ppr, int index=0)
@ ON
Enable quadrature mode CPR = 4xPPR.
void enableInterrupts(void(*doA)()=nullptr, void(*doB)()=nullptr, void(*doIndex)()=nullptr)
Pullup pullup
Configuration parameter internal or external pullups.
@ OFF
Disable quadrature mode / CPR = PPR.
Quadrature quadrature
Configuration parameter enable or disable quadrature mode.
float cpr
encoder cpr number
float getVelocity() override
int needsSearch() override
float getAngle() override
int pinB
encoder hardware pin B