Thank you Lanfra for your kind words. I really appreciate your kindness.
Do not blame the people that did not help all this time, because they may not have the knowledge or the time to work with something new.
The problem is that I don't have the controller to test the code. It is like writing code in the blind.
I have set the delay in the timer to 400 milliseconds before the timer runs the code again. This means that the value of the current degrees is checked every 400 milliseconds. You can change that by clicking on < tm0 > component and changing the < tim > value at the right side of the screen (Attributes) and adjust it at a value that can catch up the speed of the rotation.
To see if the CCW problem is caused by the sketch, press the button manually with your finger. If Arduino responds, then the sketch is ok.
Due to the code being based on a Nextion Library, the code is not as efficient as it should be and it limits us a lot.
Could you send the schematics and what type of hardware you are using?
Feel free to ask again and freely add a Karma
Thanks a lot.