Connecting rotary encoder to Arduino Nano

The library has no function for the switch. That needs to be handled separately like any momentary switch.

I use the state change detection method, but for active low switches.