Pages: [1]   Go Down
Author Topic: Sending quotation marks over serial  (Read 1048 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
God Member
*****
Karma: 0
Posts: 572
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How do you send quotation marks (") over serial? Obviously they are used in the serial.print() function to include the charachters between them, so how do you explicity include them in the string to be sent?

I don't have a c/c++ background, I can imagine there is a way to do it, but I can't find it.

Thanks,

Alex

Logged

Austin, TX USA
Offline Offline
God Member
*****
Karma: 4
Posts: 997
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

trialex--

In a C/C++ string, you can "escape" a special character by preceding it with a backslash.  For example

Serial.println("\""); // prints "
Serial.println("\\"); // prints \

Savvy?

Mikal
Logged

0
Offline Offline
God Member
*****
Karma: 0
Posts: 572
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sweet! Easy when you know how - thanks.
Logged

Pages: [1]   Go Up
Jump to: