I have an int[] containing 3 ints with values between 0 and 100. I would like to send that array from Processing to Arduino over USB. Sounds like a simple task, but I have been having some difficulties as I am new to the platform. I understand how to setup a Serial communication after reading through documentation from Arduino and Processing, but my attempts at sending this array have fallen short.
What needs to be done in Processing to properly send the int[]?
What needs to be done in Arduino to properly read the int[]?
Thanks for your guidance. These forums have been a great resource for me as I have begun to use the Arduino platform.
PaulS:
Generally, no. Sending as ASCII data, with delimiters, makes it far easier to keep in sync.
Ok so let's send it as a string. Each of the numbers would need to be separated by a common term (like '/n') I assume? So my string would look like (100+'/n'+0+'/n'+0+'/n'). Then I would do port.write(stringName)? Do the numbers need to be literals instead?
What would need to be done on the receiving end (Arduino) to reassemble the string? Sorry if I'm a bit slow; I'm still piecing things together.