https://diyprojectslab.com/rotary-encoder-with-raspberry-pi-pico/
Interfacing Rotary Encoder With Raspberry Pi Pico Tutorial