Library for two MPU9250 over I2C

Hi, Im trying to get two MPU9250 to work on one i2c port of my uno. They have diffrent addresses so this shouldnt be the problem. Im currently using this lib [url=http://https://github.com/rpicopter/ArduinoMotionSensorExample, which work flawlessly with one MPU. It should be easy enough to switch between the addreses but I cant gquite get it to work. Any hints to a different library which can be easily adapted are appreciated.

Thanks Steffen

try this library: https://github.com/bolderflight/MPU9250

you should be able to create 2 MPU9250 objects where you can specify each MPU9250 address you using,for example: MPU9250 imu_1(Wire,0x68); MPU9250 imu_2(Wire,0x69);

also check this link out for more info: https://learn.sparkfun.com/tutorials/mpu-9250-hookup-guide

Hope that helps

Hi,
Welcome to the forum.

Can you post your code please?

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Thanks… Tom… :slight_smile:

The *.h file contains only one (by default it is 0x68) address for the sensor. Therefore, the application program will always see (find ) only one MPU9250 as active sensor in the system at address 0x68. This is my understanding. If so, how to operate two or more sensors together?

Let us use the AD0 line (s) of the sensor (s) as selection lines. The value of 10 for the two AD0 lines will select the very 1st sensor (MPU9250-0), the value of 01 will select the 2nd sensor (MPU9250-1), and so on.