Hey @Sok ,
Thanks for the heads up for the library examples, I was not aware that I didn’t refactor the code well enough. I’ve updated the master branch examples.
If you are getting negative angle in each run, one of your problems can be that the motor and sensor orientation is inversed. That should be solved by inverting two motor wires for example, as @Owen_Williams already suggested.
But you have something else as a problem as well which we did not identify yet.
What is the MCU you are using?
What is the library version you are using?
Which pins are you using?