最近在学习旋转编码器,于是在淘宝上买了这个旋转编码器,还挺贵的,一个7块多,于是去arduino上看看有没有现成的库,
于是我安装了一下这个库,使用了basic基础案例,代码如下:
/* Encoder Library - Basic Example
* http://www.pjrc.com/teensy/td_libs_Encoder.html
*
* This example code is in the public domain.
*/
#include <Encoder.h>
// Change these two numbers to the pins connected to your encoder.
// Best Performance: both pins have interrupt capability
// Good Performance: only the first pin has interrupt capability
// Low Perf