> > Anybody got a good averaging algorithm? > > I have another question about this. One of my pic aplications is a > cow scale, I do my best to keep it still but you can imagine how the > cow listen to me, it don't keep still at all. The filtering I'm > doing is: VAL=(LASTVAL/7+NEWVAL)/8 I know thie is not the best way, > is the median average better in this case? I'll bet that a sample size of 8 will give you nothing but noise. METHOD 1: Slaughter the cow, weigh it, and have a barbeque.;-) METHOD 2: (easier on the cow) Another post talks about an adaptive filter. Average over a small number of readings during 1-2 seconds, display this as an initial value. Then begin averaging over longer periods and more samples. You might also try taking two readings of 8-10 samples a couple of seconds apart. If the readings are the same within a small window then the cow is momentarily still. While it is still, shoot it between the eyes and go back to method 1. ;-) Best Regards, Lawrence Lile