Instructions
IDUINO for maker’s life
66 www.openplatform.cc
Specification
Operation voltage: 5V
5Pinout
Size:32*20*30mm
Weight: 20g
2 Pinout
Pin
Description
CLK
Encoder A
DT
Encoder B
SW
Switch button
+
Power(5V DC)
Gnd
Ground
3.Example
This is a simple sketch that shows how to count the encoder position and how to determine
direction of rotation. It has no switch debounce, nor does it use interrupts. A fully developed
application might need to incorporate these in order to make it robust.
******Code Begin******
int pinA = 3; // Connected to CLK
int pinB = 4; // Connected to DT
int encoderPosCount = 0;