My favorites | Sign in
Project Home Downloads Wiki Issues
New issue   Search
  Advanced search   Search tips   Subscriptions
Issue 119: Ability to specify line endings in the serial monitor
4 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Closed:  Jul 2010

Sign in to add a comment
Reported by, Sep 19, 2009
I'm using Arduino 0017 (and very happy with the detached serial monitor)

When using the serial monitor, there is no way to send a \n or \r to the
arduino.  If I type in a line and hit enter, the line is sent with no line
ending.  I've had to switch what character I look for to terminate input to
something else in order to work around the problem.

I've been using Arduino 0017 on Mac, interfacing with diecimila,
duemilanove (328), and Modern Devices RBBB (both stock and converted to
3.3V/8Mhz and reflashed with the pro mini bootloader).
Jan 20, 2010
#1 qistoph
I was annoyed by the same incapability to send special characters.
Attached is a solution for this.

The patch adds a checkbox in the Serial Monitor. When this checkbox is checked,
escaped characters are parsed. The parsed characters are: \r, \n, \t, \b, \f, \0 and \\.

Even though Java allows 0-characters in a String, mainly for increased performance, I
have added Serial.write(byte[] bytes, int start, int length).

If you have any comments, please share.
3.1 KB   View   Download
Jan 29, 2010

Oh, great. Thanks a lot, I was just gonna smash my head with the wall lol

Could you please tell us how to install this patch though?

Apr 1, 2010
Project Member #3
(No comment was entered for this change.)
Summary: Ability to specify line endings in the serial monitor
Labels: Milestone-1.0 Component-IDE OpSys-All
May 15, 2010
Project Member #4
(No comment was entered for this change.)
Labels: -Milestone-1.0 Milestone-0019
Jun 10, 2010
#5 qistoph
Today I noticed my patch doesn't work against the latest trunk version.
Mainly because the status label was removed from the serial monitor.

Attached is a new patch.
I have added a new escape character that I was missing myself and fixed the compile errors on the status label.

The added character is \x, which can be used to send raw bytes.
Like this: \x00\x02\x04\xff
Or even: an @ is \x40

Since there's no status label to show information to the user, it's now throwing exceptions that'll land in the output window and prevent the line from being sent.
Other than the explicit IllegalArgumentExceptions in the source, it could also throw an ArrayIndexOutOfBoundsException (e.g. for "\x" or "\x0").

If this is not in line with the coding standards of the Arduino IDE, I'd be happy to help sorting this out.
4.2 KB   View   Download
Jul 11, 2010
Project Member #6

I just added support for specifying line terminators.  Ability to send and receive arbitrary binary data would be nice, but seems like a separate issue.  I imagine creating a separate UI (e.g. another tab in the serial monitor) for binary communication, rather than overloading the text field to accept escape sequences.
Status: Fixed
Sign in to add a comment

Powered by Google Project Hosting