1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

Added delays to some serial examples to avoid crashing the serial monitor.

This commit is contained in:
Tom Igoe
2012-04-09 10:48:11 -04:00
parent 6f93d3fc17
commit bde00b9be9
9 changed files with 24 additions and 19 deletions

View File

@ -12,7 +12,7 @@
* LED connected from digital pin 9 to ground
created 29 Dec. 2008
modified 30 Aug 2011
modified 9 Apr 2012
by Tom Igoe
This example code is in the public domain.
@ -46,8 +46,8 @@ void loop() {
Serial.print("\t output = ");
Serial.println(outputValue);
// wait 10 milliseconds before the next loop
// wait 2 milliseconds before the next loop
// for the analog-to-digital converter to settle
// after the last reading:
delay(10);
delay(2);
}

View File

@ -10,9 +10,9 @@
* Analog sensor (potentiometer will do) attached to analog input 0
Created 22 April 2007
modified 30 Aug 2011
By David A. Mellis <dam@mellis.org>
modified 9 Apr 2012
by Tom Igoe
http://www.arduino.cc/en/Tutorial/Smoothing
This example code is in the public domain.
@ -61,7 +61,8 @@ void loop() {
// calculate the average:
average = total / numReadings;
// send it to the computer as ASCII digits
Serial.println(average);
Serial.println(average);
delay(1); // delay in between reads for stability
}