Go Down

Topic: What do ((no line ending, newline, carriage return & both NL + CR)) do?(monitor) (Read 4142 times) previous topic - next topic

TECH GEEK

What do these do? (in the arduino's serial monitor)
so far i have yet to see any differences between them...

  • No line ending

  • Newline

  • Carriage return

  • Both NL + CR

As always... Thanks for posting!!!

Grumpy_Mike

They are options when sending stuff from the monitor to the arduino.

TECH GEEK

yeah I know they are options...

but what do they do? When should I use each one?
As always... Thanks for posting!!!

Grumpy_Mike

They do what they say.
No line ending just sends what you put.
New line sends an ASCII new line code after what you put
Carafe return puts an ASCII carriage return character after what you put, and the last one puts both a carriage return and a new line character after whatbyou put.

TECH GEEK

ohh like having an automatic end-of-phrase enter key pusher thingymagob?
As always... Thanks for posting!!!


ValeryOD

Why doesn't Serial Monitor recognize \r and \n symbols if I send them directly after the message? It seems they are being interpreted as a text.

Can I somehow type a line ending manually, with the "no line ending" option selected at the bottom of the Serial Monitor, so that I know exactly what I'm sending?

Robin2

This was a 4-years-dead thread - I haven't seen anyone resurrect one that old before.

You can have your Arduino program interpret what it receives from the Serial Monitor any way you want. So if it receives \n it can convert the 2 characters into a newline character - or into the text for a complete novel.
...R
Two or three hours spent thinking and reading documentation solves most programming problems.

ValeryOD

Je regrette such a blasphemy))
So, the behavior of "content\n" that I manually print into the Serial Monitor buffer, is not the same as received by the serial port (say, from another device using Serial.print("content\n")?
In the first case the SM would just print
"content\n",
and in the second case
"content
"
As I understand, manual printing into the SM (without additional coding for characters interpretation) always reads as a plain ASCII text, without string terminators or anything like that, right?
Thanks

Robin2

Two or three hours spent thinking and reading documentation solves most programming problems.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy