This project is based on the Oversized Media Control Volume Knob project from Prusa Research. See this blog post for more information: https://blog.prusaprinters.org/3d-print-an-oversized-media-control-volume-knob-arduino-basics_30184/
I adjusted the code to more slowly increase/decrease the volume. I also added a secondary operating mode that can be toggled by 'long pressing' the knob. While in the secondary operating mode, rotating the knob acts like a mouse wheel.