jung6717 / arduino

Automatically exported from code.google.com/p/arduino
0 stars 0 forks source link

Ability to specify line endings in the serial monitor #119

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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).

Original issue reported on code.google.com by parsen...@gmail.com on 19 Sep 2009 at 1:00

GoogleCodeExporter commented 9 years ago
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.

Original comment by qistoph on 20 Jan 2010 at 5:06

Attachments:

GoogleCodeExporter commented 9 years ago

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?

Thanks

Original comment by vagh...@gmail.com on 30 Jan 2010 at 4:26

GoogleCodeExporter commented 9 years ago

Original comment by dmel...@gmail.com on 1 Apr 2010 at 6:25

GoogleCodeExporter commented 9 years ago

Original comment by dmel...@gmail.com on 16 May 2010 at 4:16

GoogleCodeExporter commented 9 years ago
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.

Original comment by qistoph on 10 Jun 2010 at 11:01

Attachments:

GoogleCodeExporter commented 9 years ago
r989

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.

Original comment by dmel...@gmail.com on 11 Jul 2010 at 3:36