finalized version
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#ifndef ROTARY_ENCODER_DRIVER_H
|
||||
#define ROTARY_ENCODER_DRIVER_H
|
||||
|
||||
#include "digital_in.h"
|
||||
#include "digital_out.h"
|
||||
#include "timer_usec.h"
|
||||
|
||||
class RotaryEncoderDriver {
|
||||
volatile uint8_t cycle;
|
||||
volatile int16_t count;
|
||||
volatile int16_t prev_count;
|
||||
|
||||
Digital_out led;
|
||||
|
||||
Digital_in eA;
|
||||
Digital_in eB;
|
||||
|
||||
Timer_usec timer;
|
||||
|
||||
public:
|
||||
volatile int16_t delta;
|
||||
|
||||
RotaryEncoderDriver();
|
||||
void begin();
|
||||
void update();
|
||||
int position();
|
||||
void update_delta();
|
||||
float count_per_sec();
|
||||
|
||||
};
|
||||
#endif
|
||||
Reference in New Issue
Block a user