feat: 全量同步 254 个常用的 Arduino 扩展库文件
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* InterruptEncoder.h
|
||||
*
|
||||
* Created on: Oct 8, 2020
|
||||
* Author: hephaestus
|
||||
*/
|
||||
|
||||
#ifndef INTERRUPTENCODER_H_
|
||||
#define INTERRUPTENCODER_H_
|
||||
|
||||
#define MAX_ENCODERS 16
|
||||
#define US_DEBOUNCE 10
|
||||
#include <Arduino.h>
|
||||
|
||||
class InterruptEncoder {
|
||||
private:
|
||||
bool attached=false;
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
int apin=0;
|
||||
int bpin=0;
|
||||
InterruptEncoder();
|
||||
virtual ~InterruptEncoder();
|
||||
void attach(int aPinNum, int bPinNum);
|
||||
volatile bool aState=0;
|
||||
volatile bool bState=0;
|
||||
volatile int64_t count=0;
|
||||
volatile int64_t microsLastA=0;
|
||||
volatile int64_t microsTimeBetweenTicks=0;
|
||||
int64_t read();
|
||||
};
|
||||
|
||||
#endif /* INTERRUPTENCODER_H_ */
|
||||
Reference in New Issue
Block a user