averaging now on arduino

The arduino now averages the values and ensures a sample rate of about
500Hz