You should enter problem-solving mode and try to solve it image missing /media/kunena/emoticons/smile.png
First, verify that the encoder as such works and gives the right values.
Check schematics and hardware setup since you use your own pcb. A and B must go in to PA0 and PA1. They electric signal must be NPN open collector. Use interface circuitry if needed.
Check that it counts up and down using the debugger.
Add a line first in loop()
Code:
double pos =Encoder1.currentPos();
Use this a breakpoint and watch that pos changes value as you rotate the encoder shaft.
Read up on debugger usage if you haven't used it before. But it is basically just to start it with Run -> Start debugging and then single step into or single step over and watch values in the left column.