Other
ESP8266/Arduino Library for reading rotary encoder values.
It allows you to use callback functions to track rotation. This will reduce and simplify your souce code significantly. Tested with Arduino and ESP8266.
Maintainer: KAthiR
This library is compatible with all architectures so you should be able to use it on all the Arduino boards.
To use this library, open the Library Manager in the Arduino IDE and install it from there.