How do I Receive Multiple Arduino Values to Processing

Hi,

I’m currently having some issues with getting my data glove working on Processing. The Arduino code is running perfectly, but the Processing code isn’t. The sliders should be moving individually for the accelerometer, gyroscope and fingers! When I run the program in Processing, the sliders move in similar positions at the same time.

Does anybody have suggestions on a similar project?

Thanks.

sketch_190327b.pde (3.93 KB)

Data_Glove_2.ino (14.6 KB)

You are printing a LOT in the main loop. Cut it down to just print the values you are interested in, with an appropriate start and end character.

Start here: Serial Input Basics

You also have a Serial.begin() in the middle of the loop. That’s not necessary.

// Fingers

sensorValue1 = int(480 - (160 * (acceleration * 0.01)));
sensorValue2 = int(480 - (160 * (acceleration * 0.01)));
sensorValue3 = int(480 - (160 * (acceleration * 0.01)));
sensorValue4 = int(480 - (160 * (acceleration * 0.01)));
stroke(0);

Your Processing code only attempts to read one value from the Serial stream and then uses that same value everywhere. It is doing what it is told to do.

MorganS:
Your Processing code only attempts to read one value from the Serial stream and then uses that same value everywhere. It is doing what it is told to do.

I commented out the code I don't need to use in Arduino. I'm still unsure on what code will I need to send the data to Processing.

MorganS:
Start here: Serial Input Basics