Head SPINning trying to SPIN heading !
NR1X
Posts: 111
HI All, Longtime lurker here but still an infant in the world of propellers.
What Im attemting to do seems fairly simple, but it involes math, and thats where I hit the wall...Here's the scene... I have 8bit adc value (read from antenna rotor indicator signal) from 0-255, and I need to see that data as 0-360( as in degrees). That part doesnt seem to be too complicated, but here is where it gets a little more complex. 0 deg is actually center on the incoming signal, so adc-0 := 181deg. and adc-255 := 179deg with adc-127 := 0 (or 360) deg.
I know this is silly simple to do, I just dont know where to start.
NR1X, Al, CT
What Im attemting to do seems fairly simple, but it involes math, and thats where I hit the wall...Here's the scene... I have 8bit adc value (read from antenna rotor indicator signal) from 0-255, and I need to see that data as 0-360( as in degrees). That part doesnt seem to be too complicated, but here is where it gets a little more complex. 0 deg is actually center on the incoming signal, so adc-0 := 181deg. and adc-255 := 179deg with adc-127 := 0 (or 360) deg.
I know this is silly simple to do, I just dont know where to start.
NR1X, Al, CT
Comments
Make "heading" a long sized variable to be safe from overflowing the byte size limit.
Here's my guess at the equation.
I haven't tested it (but I'm pretty sure it should work).