How do rotary knobs work in electronic devices?
Knobs that turn more than 360 degrees typically have some kind of counter attached. Much like the computer mouse with a ball in it, there is a little device capable of recognizing movement (usually rotation of a wheel) and a circuit counts the turns. Typically there is a wheel with lots of little holes spaced around it which alternately block and don’t block light from a LED and a photo sensor counts the number of times the light gets blocked. By putting two sensors at just the right spacing you can tell which way the wheel is turning by which of the sensors is blocked first. There are other ways of doing this, but this is probably most common.