We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › best way to receive and parse messages from serial
Page Index Toggle Pages: 1
best way to receive and parse messages from serial (Read 773 times)
best way to receive and parse messages from serial
Sep 22nd, 2009, 1:47pm
 
I am sending x,y and z coordinates from Arduino as int values. Since they are turned into ascii the number of bytes per number varies.
i.e. 0 is one byte  but the number 123 would be three bytes sent.

What is the best way to have processing receive these three values?

i.e. How should I separate them in the arduino code and then how do I parse them?
Should I have a start byte and end bytes seperating the numbers and identifying the start of each data string that contains all three values?
Re: best way to receive and parse messages from serial
Reply #1 - Sep 22nd, 2009, 2:48pm
 
just send them as one String seperated by any Char you want and seperate them again using http://processing.org/reference/split_.html
Page Index Toggle Pages: 1