I am attempting to measure rotational velocity by sampling a number of recent compass readings. This works fine except that I get spikes when it hits the wrap-around point (360 to 0 or 0 to 360). I'd like to filter those out somehow if possible.
I could lengthen the buffer to lessen their impact, but that's not the scientific approach!
Any suggestions? Here is the patch: