51 this->pointer = _pointer;
56 TCCR1A = (1 << WGM11);
57 TCCR1B = (1 << WGM12) | (1 << WGM13) | (1 << CS10);
66 TIMSK1 = (1 << OCIE1A);
100 if((status & 0xE0) != 0x80)
125 this->
status = pointer->SPI(0x00);
135 return (
float)
angle * 0.005493164;
uStepperEncoder(void)
Constructor of uStepperEncoder class.
#define ENCODERDATATOSTEP
volatile posFilter_t encoderFilter
float getSpeed(void)
Measure the current speed of the motor.
int32_t getAngleMovedRaw(void)
Returns the angle moved from reference position in raw encoder readings.
#define ENCODERDATATOREVOLUTIONS
Prototype of class for accessing all features of the uStepper S in a single object.
float getAngleMoved(void)
Returns the angle moved from reference position in degrees.
void setHome(void)
Resets the internal position counter of the motor driver.
volatile int32_t angleMoved
uint16_t captureAngle(void)
Capture the current shaft angle.
volatile uint16_t oldAngle
uint16_t getAngleRaw(void)
Return the current shaft angle in raw encoder readings.
void setHome(void)
Define new reference(home) position.
volatile int16_t revolutions
float getAngle(void)
Return the current shaft angle in degrees.
void init(uStepperS *_pointer)
Initiation of the encoder.
void chipSelect(bool state)
Set the output level of the chip select pin.
float getRPM(void)
Measure the current speed of the motor.
bool detectMagnet(void)
detect magnet
uint8_t getStatus(void)
Get encoder status.
Function prototypes and definitions for the uStepper S library.