Can someone explain to me what analogReadAveraging does? I seem to have better noise rejection using analogReadAveraging versus a manual averaging, i.e. the results from the following pseudo codes are not the same
versus
This is especially true when reading a value that is very close to ground. For the first piece of code, I got an average ADC value of around 2 to 3, but for the second piece of code, I got an average ADC value of around 8 to 9. Both on are 12 bit resolution.
Code:
analogReadAveraging(16);
analogRead(A0);
versus
Code:
analogReadAveraging(1);
for (i=0;i++;i<16)
average the 16 readings from analogRead(A0);
This is especially true when reading a value that is very close to ground. For the first piece of code, I got an average ADC value of around 2 to 3, but for the second piece of code, I got an average ADC value of around 8 to 9. Both on are 12 bit resolution.