Hello! I'm from Russia, and sorry for english at first! )
I can't send long strings over serial connection because my Uno can't catch '\n' symbol!!!
This Example (http://arduino.cc/en/Tutorial/SerialEvent) not working!
But other symbols working normally!!!
What i do wrong??
Or what i must do something else to send over serial connection long strings, not "one shot" chars???
IvanDeft:
What i do wrong??
Are you using the Arduino Serial Monitor window?
At the bottom of the Serial Monitor is a menu for selecting the line ending character. If it is set to one of the options that does not send '\n' that would explain why your sketch is not receiving '\n'.
The example explains that the '\n' is used as a end of string.
if (inChar == '\n') {
stringComplete = true;
}
The example is working just as it is supposed to.
Thank you!
)))
But now it's working in Serial Monitor. What will be if i want connect tho boards and send long strings from one to second???
It will be working without checking "new line symbol"???
IvanDeft:
But now it's working in Serial Monitor. What will be if i want connect tho boards and send long strings from one to second??? It will be working without checking "new line symbol"???
If you want to send 'messages' instead of 'characters' you need a way for the receiving system to recognize when it has received the end of the 'message'. You can use '\n' or some other character that is not going to be part of your message. Even if your messages are fixed in length (always the same number of characters) it is good to add special characters before and after the message to protect against data loss or data inserted due to noise.
If you send the string make sure you add the new line indicator to the end when you send it.. You need some sort of delimiter between messages or it will be hard to synch up if you get garbled messages (which will happen).
Thank you very much! )