Hi Guys,
Maths isn't my strong point so I'd be grateful if someone could talk me through this.
I'm reading a readadc10 and trying to convert the result into 0 to 359
Although w0 reaches 1023, w1 never gets above 351. Doing the maths on an integer-only calcualtor is the same. I'm hoping that, as 1023 represents over 2.8 "units" per degree (the 360), I'd get better resolution than that.
John.
Maths isn't my strong point so I'd be grateful if someone could talk me through this.
I'm reading a readadc10 and trying to convert the result into 0 to 359
Code:
do
readadc10 C.1, w0
w1 = 360 / 32 * w0 / 32 ; saw that trick somewhere :)
debug
pause 100
loop
John.