I'm trying to overwrite in the serial monitor by using
Serial.print("stuff");
Serial.print("\r");
which, by syntax, ought to simply keep printing stuff over itself on the same line on the monitor. At least, logic tells me that. But it simply prints stuffstuffstuffstuff ad nauseam.
The terminator setting in the serial monitor doesn't do anything.
I tried Serial.write(13); to no avail, even the archaic Serial.write(15).
so why doesn't the serial monitor, which apparently respects \n and even \t etc do the right thing?
start dumb rant
And WHERE is the list of the commands the serial monitor WILL do? I've tried the forum search and the language search. I guess we are supposed to be born with this information imprinted.
end dumb rant.
I know the endless "stuff" strings are going into memory somewhere and eventually the computer will unceremoniously crash.
Is there some reason cr doesn't cr?
Thanks
Don
The Arduino serial monitor is a very dumb piece of code. I don't mean that the code is written badly, or whatever, just that it is a system which has no intelligence in it.
It accepts characters from the serial device, and then appends them to a JTextArea component. This component is not able to do any processing of the data in any way - it is just a plain text box. Kind of like a ... in HTML.
There is no processing of the incoming data at all either - so no matter what arrives it just gets passed straight to the JTextArea. The JTextArea only knows about tabs and new-line characters, and nothing else. Some things, like carriage return characters, just get completely ignored by it.
As I mentioned earlier, UECIDE has a proper ANSI terminal (well, it supports a subset of the ANSI specification at the moment), which handles carriage returns properly. It also handles ANSI colour, and ANSI cursor positioning sequences too, which makes it much better for creating a data display than the basic what-you-send-is-what-I-print of the JTextArea implementation.
Other options, which aren't probably as "easy" involve using an external program to do the serial display - this is not as good as it requires you to manually close the connection in order to upload a new version of your sketch. However, ANSI emulation in these programs is generally much better and more complete.