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: https://gist.github.com/savetheclocktower/9b5f67c20f6c04e65ed88f2e594d43c1

Change the GPIO pin definitions in the script https://gist.github.com/savetheclocktower/9b5f67c20f6c04e65ed88f2e594d43c1#file-monitor-volume-L33-L38

Also change all references to the "PCM" device to "HDMI". https://gist.github.com/savetheclocktower/9b5f67c20f6c04e65ed88f2e594d43c1#file-monitor-volume-L188-L223

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.