Help with video game controller using rotary encoder on the Arduino Leonardo

So is that a physical lock, as in the wheel will not turn any more? Or is it a virtual lock when the wheel still spins but does not exceed a specific value?

If the latter, this is easy to do, you simply use a while loop, that checks if the value of the counter exceeds your limiting number, and if it does then decrement the counter.

A physical lock would involve the same sort of logic but you would have to have a solenoid that clamps the wheel until the count is less than the maximum value.

I am not sure, but from your photograph that rotary encoder looks like a hall effect one which if true explains why you do not need two 0.1uF ceramic capacitors between output pulses and ground.

1 Like