Wednesday, December 9, 2020

ORTHOPI rotary encoder

Rotary encoder connected and setup as volume control

I connected the encoder to the GPIO header with the same 30awg wire I used for the other connections.

There are 4 connections, Ground (black), Encoder A (yellow), Encoder B (orange), Switch (blue).The ground connection is shared for the encoder and the switch.

I soldered directly to the GPIO header. I chose GPIO 17, 27, and 22 since they are easy to access.

I followed the instructions and modified the script I found here:

Change the GPIO pin definitions in the script

Also change all references to the "PCM" device to "HDMI".

I had Encoder A and Encoder B swapped so had to swap GPIO 17 and 27 to get the volume to go up when turned clockwise.