WIRING of KY-040 Rotary Encoder plus Demo Code

bennygodlin:
I have played quite a bit with this rotary encoder
and got to several conclusions:

  1. You must use ISR to detect A and B pin changes

Or write code that runs smoothly. ("Blink without delay"/ State Machine.)