What is the need of delay after serial.print and will it affect the ADC sampling rate.
In the following code the ADC sampling rate is 9.6KHz by default, and will delay(100) in loop affect sampling rate.
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(2000000);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0 and 1:
float a0 = analogRead(A0);
// print out the value you read:
Serial.println(a0 * 5 / 1024);
delay(100);
}
Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'
Use [color = red]code tags[/color] (the </> icon above the compose window) to make it easier to read and copy for examination
LarryD
3
delay(100); // 100ms
That delay is to slow down the output to the serial monitor so things don't scroll too fast for you to read.
1/2 second might be even better 