I switched the cases '0' and '1' in the case structure since the values should be collected in the array as long as the loop is NOT on every 10th count. When it reaches the 10th count, the quotient is '1' and the array gets passed to 'Mean' to be averaged. However, this didn't work either. I now saw the mean value change after 10 seconds for the first time but thereafter it changes every second and reaches a constant value after 10 changes.
av10