It sometimes find the angle spot on, but somtimes its 3.14rad/180degree from the correct angle. Resetting the microcontroller sometimes helps. Don't know why
It seems like it hugs +-180 degrees when uploadning code from STM32cubeIDE, but when it's reset, it finds the right angle.
Maybe it's something to do with the IDE.
It sometimes find the angle spot on, but somtimes its 3.14rad/180degree from the correct angle. Resetting the microcontroller sometimes helps. Don't know why