Serial.print() - broken messages

Hi all, I´ve got Arduino Diecimila and I´ve been trying serial communication with my Python script. Everything was fine, until i tried to send some message using Serial.print() function. For example, if the message is something like "123", Python gets "123", but sometimes also "1\n23" or "12\n3". The message is broken and it is stored in buffer like 2 messages. Why? And how to solve it?

I didn´t find the solution, so please, can anybody help me to solve this problem? Thanks a lot. Michal (and sorry for my English)

Does the value arrive correctly if you use something other than Python? Does the development environment correctly capture and display the value?

  • Brian

I think i know, where the problem is. My Python skript reads the messages from buffer in a loop, but the problem is, that the whole message isn´t in the buffer yet. I think the solution is to use some character like .,:!?... to know where the message starts and where it ends.