2 Star 2 Fork 3

Kono/grbl_controller_stm32

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
RotaryEncoder.h 1.07 KB
一键复制 编辑 原始数据 按行查看 历史
mstrens 提交于 2018-11-22 10:27 . Initial commit
// -----
// RotaryEncoder.h - Library for using rotary encoders.
// This class is implemented for use with the Arduino environment.
// Copyright (c) by Matthias Hertel, http://www.mathertel.de
// This work is licensed under a BSD style license. See http://www.mathertel.de/License.aspx
// More information on: http://www.mathertel.de/Arduino
// -----
// 18.01.2014 created by Matthias Hertel
// -----
#ifndef RotaryEncoder_h
#define RotaryEncoder_h
#include "Arduino.h"
#define LATCHSTATE 3
class RotaryEncoder
{
public:
// ----- Constructor -----
RotaryEncoder(int pin1, int pin2);
// retrieve the current position
long getPosition();
// adjust the current position
void setPosition(long newPosition);
// call this function every some milliseconds or by using an interrupt for handling state changes of the rotary encoder.
void tick(void);
private:
uint8_t _pin1, _pin2; // Arduino pins used for the encoder.
uint8_t _oldState;
long _position; // Internal position (4 times _positionExt)
long _positionExt; // External position
};
#endif
// End
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/Kono2019/grbl_controller_stm32.git
git@gitee.com:Kono2019/grbl_controller_stm32.git
Kono2019
grbl_controller_stm32
grbl_controller_stm32
master

搜索帮助