Writing and reading multiple values through serial I am currently busy with a project that requires me to use an Arduino and 3 potentiometers (to change background in RGB format) to write values through the serial port and read and separate them in processing.

What I want to do is to be able to use my Arduino to write multiple values to a processing program. I am quite new to coding and its been a while since I worked with my Arduino. I know how to read and write one value, but not multiple values.

Also is there a way to write 20 values?

Thanks in advance!
The simplest way is to just print them as a single line and separate them with "something". That "something" could be as simple as a space.

Serial.print(val1);
Serial.print(" ");
Serial.print(val2);
...
Serial.print(" ");
Serial.println(val20);


743 234 34 599 2 ... 427 1013 48 2 409


Then in processing you just read the entire line into a String and split it on the spaces into an array.