Pages: [1]   Go Down
Author Topic: Other Serial.print special characters?  (Read 1867 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 0
Posts: 102
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I noticed that serial.print has a special character for tabbing.

  Serial.println("\t");

Are there any others?  I thought it might be nice for making debug pretty.

I ran the alphabet and the complier accepted these

  Serial.println("\a");
  Serial.println("\b");
  Serial.println("\v");

I have no clue what it spits out.  The debug window gave me junk that's I can't get to show up in the fourm.

Is there a list? Is these a carriage return?  Others?

thanks in advance!

gg
« Last Edit: December 31, 2010, 04:47:36 am by george_graves » Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 207
Posts: 12917
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


There are "special characters" but what's important is the receiving side.  That's where the characters are interpreted.  From the sender's perspective, they are just 8 bit values.

What are you using?  Serial Monitor?

"\r" is carriage-return.
"\n" is line-feed.

I believe Serial Monitor interprets "\r\n" as "advance to the next line".
Logged

Copenhagen / Denmark
Offline Offline
Edison Member
*
Karma: 6
Posts: 2360
Do it !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Here's a list of the commonly used escape chars in C programming.

http://msdn.microsoft.com/en-us/library/h21280bw%28v=vs.80%29.aspx

I don't know if all of them are implemented on the Arduino.

EDIT:

Of course those that has to do with UNICODE chars are not implemented on Arduino.
« Last Edit: December 31, 2010, 04:59:02 am by MikMo » Logged

Pages: [1]   Go Up
Jump to: