Go Down

Topic: Sending quotation marks over serial (Read 2029 times) 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
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy