Any solution to relate the code to the line number?

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.

Or a more generic:

  Serial.println("test print 0001");
1 Like