Best way to emulate a rotary encoder wheel?

or something like this

3 Likes