How to read multiple sensors in Processing using Arduino I2C

ok,
if i remove the commented part in your arduino code is :

#include <WT50.h>
#include <WT49.h>

void setup() 
{
  Serial.begin(115200);
  WT50.startIIC();
  WT49.startIIC();
} 

void loop() 
{ 
//  Serial.print("Angle:");
  Serial.print(WT50.getRoll());
  Serial.print("/");
  Serial.print(WT50.getPitch());
  Serial.print("/");
  Serial.println(WT50.getYaw());

 // Serial.print("Angle:");
  Serial.print(WT49.getRoll());
  Serial.print("/");
  Serial.print(WT49.getPitch());
  Serial.print("/");
  Serial.println(WT49.getYaw());

}

here are some strange format: first 3 values separated with “/” third value is followed by “\r” due to println in Serial.println(WT50.getYaw());
than 3 others values with print and finally println
so it’s two lines sent by arduino code

on processing side

you read until end of line, so only one set of value is read

i think first is to have this more coherent:

//  Serial.print("Angle:");
  Serial.print(WT50.getRoll());
  Serial.print("/");
  Serial.print(WT50.getPitch());
  Serial.print("/");
  Serial.print(WT50.getYaw());
  Serial.print("/");

 // Serial.print("Angle:");
  Serial.print(WT49.getRoll());
  Serial.print("/");
  Serial.print(WT49.getPitch());
  Serial.print("/");
  Serial.println(WT49.getYaw());

}

now you have 6 values on same line

on processing side you need to read them all:

      roll50 = float(items[0]);
      pitch50 = float(items[1]);
      yaw50 = float(items[2]);

      roll49 = float(items[3]);
      pitch49 = float(items[4]);
      yaw49 = float(items[5]);

i recommand to put
println( roll50, pitch50 , yaw50, "-", roll49 , pitch49, yaw49 );
on your draw() to check data are correct then from here, you can draw stuff according to those values

i’m not sure my explanations are clear, don’t hesitate to ask if needed