why need a delay between readings?

hello, everyone:

when i learn the tutorial in

both example code have a line of code of delay(1) and i cannot understand the comments clearly. The stability for/of what?

https://www.arduino.cc/en/Reference/AnalogRead

Perhaps some are using the delay to filter noise from the signal?

There is no delay in the link you gave. And there would be no point in one!

Mark

On my screen they both have a delay :o
The delay is in the tutorial but on in the reference.

reading_he, the delay of 1ms is not really needed for "stability". However, sending a lot of data to the serial monitor with an Arduino Leonardo is not very nice, it might clog up the serial communication and uploading a sketch might fail. Therefor I would use a delay of 100ms to slow down the sketch.

The digitalRead() and analogRead() themself don't need a delay at all. It is only about the amount of data send to the serial monitor.

Cross-posted to Arduino Stack Exchange

That's two timing, having an affair and cheating on us. :wink:
.

Thanks.

reading_he:
both example code have a line of code of delay(1) and i cannot understand the comments clearly.

Me, too.

In both code examples the line containing "delay()" is not of any use.
It can be replaced by an empty line, deleted line, or you can comment it out easily without seeing a difference.

Both code examples have "Serial @9600 Baud" as a bottleneck which is slowing down the loop() function more than 1ms. So an additional 1ms delay() will not make any difference. It's a waste in both code examples.

reading_he:
both example code have a line of code of delay(1) and i cannot understand the comments clearly. The stability for/of what?

Without a short delay() the Arduino would be sending a huge amount of data to the Serial Monitor. To be honest I would have delay(500) so I only get a new value twice per second.

analogRead() only takes about 100 microseconds and digitalRead() maybe 5 microseconds

I agree that the comment in the code is not adequate.

...R