File management and Completed Part 1
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
#ifndef ENCODER_H
|
||||
#define ENCODER_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <digital_in.h>
|
||||
|
||||
class Encoder
|
||||
{
|
||||
public:
|
||||
Encoder(uint8_t c1Pin, uint8_t c2Pin);
|
||||
|
||||
void init();
|
||||
void update();
|
||||
|
||||
int32_t position() const;
|
||||
|
||||
private:
|
||||
Digital_in c1;
|
||||
Digital_in c2;
|
||||
|
||||
uint8_t c1Pin;
|
||||
|
||||
bool previousC1;
|
||||
|
||||
volatile int32_t count;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user