arduino processing serial issues

Ok, I've got issues here with arduino and processing. I have about 70 different sensors, and all of them are producing the same errors. It happens whether I write the code or use examples. changing the baud rate in the two programs does nothing. so basically, here's the problem: the serial monitor in Arduino is fine, sending totally perfect data, right? until I open a processing sketch, then my stream of data in the arduino serial monitor goes haywire. for instance, a stream that looks like this:

83 83 83 83 84 84 84 85 85 85

will suddenly go like this when processing takes over the serial:

8 38383 8888 333 3 8 3333333


44448888 8584

any ideas??? please help

I am getting the same thing. I was using the example for VirtualColorMixer but did a few modifications to make it 4 sensors and integers.

When I look at the serial monitor on the Arduino, it gives me my string "855,455,635,50" "855,455,635,50" "855,455,635,50" etc...

But when I start the Processing app, it starts to go weird "394849,2320,3,0,123,0,123" "323,43" "5" "394849,2320,3,0,123,0,123,394849,2320,3,0,123,0,123" etc....

So somewhere I guess the Processing app must be adding more serial messages, because the length of the array created doubles.

If anybody has any ideas on how to solve this it would be greatly appreciated.


*** Here is my modified code for the last function ***

void serialEvent(Serial myPort) {

// get the ASCII string: String inString = myPort.readStringUntil('\n');

if (inString != null) {

// trim off any whitespace: inString = trim(inString);

// split the string on the commas and convert the // resulting substrings into an integer array: int[] sensors = int(split(inString, ","));

// if the array has at least X elements, you know // you got the whole thing. Put the numbers in the // color variables: //println(sensors.length); if (sensors.length >=sections) { section_A=sensors[0]; section_B=sensors[1]; section_C=sensors[2]; section_D=sensors[3]; } } }

you have to close the serial monitor


I probably never would have figured that out. Thank you very much. :)

no problem. i couldn't figure it out forever either