2

Has anyone noticed that if calling analogRead() in a consecutive way that the value drops by a bit as opposed to just doing a single read?

And is this to be expected?

I am using a Seeeduino XIAO.

MeSo2
  • 177
  • 10
  • You need a short delay between analog reads, more about it here: https://www.quora.com/Why-is-a-little-delay-needed-after-analogRead-in-Arduino – Nino Jul 18 '21 at 15:10
  • @Nino Thank you. That would explain it! (Add it as answer and I mark it as solution.) – MeSo2 Jul 18 '21 at 15:23

1 Answers1

1

You need a short delay between analog reads due to the time it takes to complete a reliable ADC reading. In depth technical explanations can be found here, note that it refers to AVR architecture.

Nino
  • 411
  • 4
  • 9