On 14/5/19 9:45 π.μ., Roman Haefeli wrote:
Hi Ingo
On Tue, 2019-05-14 at 07:38 +0200, Ingo wrote:
I'm getting number 10 instead of 13 from my adruino.
This sounds somehow familiar to me, but I can't recall the exact details of the issue nor am I able to find something about it on the web.
Have you ruled out any other source besides [comport]? Can you print the data with some other tool to make sure that the Arduino is not messing up the bytes 10 and 13? If it indeed [comport] is the culprit, then it should be quite easy to fix, but then again there we probably would find code that does the translation. I am not sure such code exists.
I have been having the same issue for quite some time now, and have posted it in this list in the past. Martin Peach replied by saying that he couldn't reproduce it and that [comport] doesn't interpret anything, so it shouldn't be a problem with the object, but I would leave that to him again, or anyone else who can give a definite answer.
I have tried Serial.write(13) and Serial.print((char)13) and they both output 10 in Pd. The work-around I have figured to this is to write a second byte after every value I send, and in case of sending a 13, send a unique value to this second byte, so that Pd knows it should be receiving a 13. It's double the load but in most cases it shouldn't be a problem, especially when writing raw bytes with Serial.write().