Hi,
I put some serial.printer() in the sketch, can relate it to the line number?
/*
AnalogReadSerial
Reads an analog input on pin 0, prints the result to the serial monitor.
Graphical representation is available using serial plotter (Tools > Serial Plotter menu)
Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.
This example code is in the public domain.
*/
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
// print out the value you read:
Serial.println("sensorValue at 21");
delay(1); // delay in between reads for stability
}
say the line 21 relate to: Serial.println("sensorValue at 21");
and if some thing modified, the line number '21' can relatively change?
Thanks
Adam
Why is the line number important? You need to read the source code to find out the line number. So just call out the program step:
Serial.println("sensorValue was obtained");
It's not too hard to read the output and find that in the code. You can even copy the string from the output and then use the find key to locate it in the source.
Thanks.
If I have many Serial.println(), it's easy to have line nubmer there.
I've used Serial.println("test print 0001"); way, still need search if the sketch is large.
BTW the forum software delays some responses, from a particular user's point of view. So the answer before mine was not visible when I posted... not great.
It's not a matter of delaying. If you opened the thread any time BEFORE that previous message was posted to the database, by it's author clicking the "REPLY" button, you won't see it until you close the thread, then re-open it. I've VERY rarely, if ever, seen a forum that works any other way. Making everyone's display update instantly would make the entire forum, and the database itself, massively slower, and more bandwidth-intensive.