Go Down

Topic: How to send a <return> with Serial Monitor (Read 3424 times) previous topic - next topic

Kitep

How can I use the Serial Monitor to send a <return> (CHR$(13))?

mellis

Right now, you can't, although this is something I'd like to add.

PaulS

You could use some other terminating character, and have the Arduino recognize that character or the CR as the carriage return.

You could also write your own version of the Serial Monitor window. I did that in C# in less than an hour. Mine can send, or not, the CR/LF combo.

mem

Quote
Right now, you can't, although this is something I'd like to add.

that would be a very welcome addition.

I have noticed that some people assume that a cr/lf will be sent at the end of every message sent from serial monitor. Having an option to enable this behaviour would help for them.

Kitep

Quote
Right now, you can't,


Thanks.  It's nice to know I wasn't missing something.

Kitep

Quote
You could use some other terminating character, and have the Arduino recognize that character or the CR as the carriage return.

I saw that mentioned when I was searching for a way to send a CR.  I didn't see how to do it however.

Quote
You could also write your own version of the Serial Monitor window. I did that in C# in less than an hour. Mine can send, or not, the CR/LF combo.

You make it sound so easy  :)

Kitep

Quote
I have noticed that some people assume that a cr/lf will be sent at the end of every message sent from serial monitor.

I was trying to interface the Arduino with another software package, which does send a CR (but not a LF) at the end of every message.  But it's easier to debug my Arduino code if I can use println messages at certain spots, so I was hoping to use the Serial Monitor to send/receive.  The ability to send a CR would be helpful indeed.  But I've learned to manage without  8-)

PaulS

Quote
I didn't see how to do it however.


Suppose that you decide that the terminating character is CR or @. Since you can't send the CR, you have to send the @. That shouldn't be too hard to figure out how to do.

If the data being sent controls an LED on a pin, you might send 'O', 'n', ',', '1', '3', '<CR>' from the program. In the serial monitor, you'd type "On,13@" instead.

Then, in the Arduino code, break out of the loop for reading serial data when the character read was a CR or an @.

Kitep


Go Up