feat: 全量同步 254 个常用的 Arduino 扩展库文件

This commit is contained in:
yczpf2019
2026-01-24 16:05:38 +08:00
parent c665ba662b
commit 397b9a23a3
6878 changed files with 2732224 additions and 1 deletions

View File

@@ -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_ */