moving average

Hi All,

I am also working on application to read the sensor data into an array and take an average for every 20 samples.I am not able to do it.Same value from sensor is copied to all 20 values in array.

Can any one help me on this.

You should start a new question rather than open a 4-year-old thread (unless , perhaps, you have the same code as that thread).
You need to post your code and more details of the problem.

naga_jyothi:
Same value from sensor is copied to all 20 values in array.
Can any one help me on this.

There is clearly an error in the sketch you did not post. Without seeing the sketch it is very hard to guess what the mistake might be.

naga_jyothi:
Same value from sensor is copied to all 20 values in array.

That is usually caused by this:

// move all the values along by one
for(int i = 1; i<20; i++) {
  data[i] = data[i-1];
}