I've got the Cmps03 with the pmw signal connected and I get values from 0 to 360. But for my project I need values which go from 0 to 180 only(e.g. 270 is - 90, 90 is 90, 180 is 180, 300 is - 60,...) how can I achieve this ? I tried some things like 180 - value but then 0 is 180 and 180 is 0.
if (angle > 180)
angle = angle - 360;
ohh oops I was thinking of a mathmatical function all the time but it is that easy. Thank you!