User Manual
Table Of Contents

43
Pin 2: generally connected to ground.
Pin 1 & 3: first connected to a pull-up resistor and then to a microprocessor (in this
experiment, to GPIO0 and GPIO1 of Raspberry Pi); when you spin the knob of the encoder
clockwise and counterclockwise, there will be pulse outputs in pin 1 and pin 3.
If both GPIO0 and GPIO1 are at high level, the switch rotates clockwise; if GPIO0 is at high
level but GPIO1 is low, the switch rotates counterclockwise. Therefore, when programming,
you only need to check the state of pin 3 when pin 1 is at high level, and then you can tell
whether the switch rotates clockwise or counterclockwise.
Experimental Procedures
Step1: Build the circuit
Raspberry Pi Rotary Encoder Module
3.3V ---------------------------------- +
GND ---------------------------------- GND
GPIO0 ---------------------------------- DT
GPIO1 -------------------------------- CLK










