Go Down

Topic: Sending quotation marks over serial (Read 1 time) previous topic - next topic

trialex

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


mikalhart

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

trialex

Sweet! Easy when you know how - thanks.

Go Up