I played with Darrels 16 bit fast averaging routine and changing the values in HystLevel, AvgCount, FAspread, I got a very slow changing average if the sampling value was close to the average.
But if suddently the input was grounded or connected to Vdd, then the Value of the average was instatly zeroed or maximized (1024 or 255 according).
It is an amazing routine. Great job Darrel, once again.
So, do not be afraid of changing the User Options as Darrel marked them and experiment.
Ioannis
Test code:
Code:
include "Fast_Average.pbp"
lcdout com,1
while 1
lcdout com,$80,#Value," "
adcin channel,var
Value=var
gosub average
pause 100
wend
Bookmarks