Mine did some averaging, not much. Read the sensor couple of time (10-16 times) then calculate the average of it, go to next channel, do the same, show the results.
I did it the 'bad' way
Code:
for loopw = 0 to 15
ADCIN 0, TEMPW
VA1=VA1 + (TEMPW>>4)
NEXT
pause 500
FOR LOOPW=0 TO 15
ADCIN 1, TEMPW
VA2=VA2 + (TEMPW>>4)
NEXT
lost of precision and so on, now for something better, have a look at Darrel's routine.
Averaging 16 bit values without using 32 bit math?
http://www.pbpgroup.com/modules/wfse...hp?articleid=7
Last edited by mister_e; - 9th December 2007 at 17:29.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks