Fix the 0-360 transition problem when the accelerometer angle jumps between 0 and 360 degrees