Connecting two BNO055 sensors to one Arduino Uno

Hello,

I am currently working on a wearable project using two Adafruit BNO055 Absolute Orientation sensors and one Arduino Uno. I am attempting to read both sensors simultaneously.

I currently have the two sensors hooked up: both wired SCL to analog 5, SDA to analog 4, VIN to 5v, GRN to ground and bnoB has the ADR pin wired to 3.3v to change its i2c address.

When I run the i2c_scanner, it recognizes two separate i2c addresses, but when I try to run my code to get Euler angles from both sensors, it just prints one sensor's values twice.

I am not experienced in coding and have had to research up to this point on how to do all of this, so any input would be greatly appreciated!

Thanks!

eulerangles.ino (3.99 KB)

in you code here:

  imu::Vector<3> euler = bnoA.getVector(Adafruit_BNO055::VECTOR_EULER);

  /* Display the floating point data */
  Serial.print("X: ");
  Serial.print(euler.x());
  Serial.print(" Y: ");
  Serial.print(euler.y());
  Serial.print(" Z: ");
  Serial.print(euler.z());
  Serial.print("\t\t");

bnoB.getVector(Adafruit_BNO055::VECTOR_EULER); //<---------------------

  /* Display the floating point data */
  Serial.print("X: ");
  Serial.print(euler.x());
  Serial.print(" Y: ");
  Serial.print(euler.y());
  Serial.print(" Z: ");
  Serial.print(euler.z());
  Serial.print("\t\t");

should marked line not be this instead to get bnoB results?

imu::Vector<3> euler = bnoB.getVector(Adafruit_BNO055::VECTOR_EULER);

I get an error message that says " redeclaration of 'imu::Vector<3u> euler' " if I try that.

asnider2:
I get an error message that says " redeclaration of 'imu::Vector<3u> euler' " if I try that.

my bad.

so change it to "imu::Vector<3> eulerB = bnoB.getVector(Adafruit_BNO055::VECTOR_EULER);" (could rename the other one to eulerA :wink: if you wanted to)

dont forget to update the serialprints as well!

That fixed the error message, but the outputs are still printing the value of sensor A for both outputs.

Hello, there.

Have you solved this problem?

If yes, would you like to share the code,plz?

Thanks a lot.