rpicopter / ArduinoMotionSensorExample

MPU6050/MPU6500/MPU9150/MPU9250 over I2c for Arduino
117 stars 43 forks source link

Multiple MPU support #4

Open letaureau opened 9 years ago

letaureau commented 9 years ago

Hi, As Arduino Mega has 2 SDA SCL ports i was thinking to incorporate 2 or more MPUs in 1 arduino. Can you guide me how to modify the code so it reads both MPU data?

gregd72002 commented 9 years ago

Hi, MPUs are I2C device so you can have multiple devices easily connected to a single SDA & SCL. They then have to be set to have different addresses so you can speak two both of them.

What you are looking for is the mpu.cpp file. The open and update method need to be tweaked so you pass the address of the device you want to read from. It is pretty straight forward.

On 16 February 2015 at 20:09, letaureau notifications@github.com wrote:

Hi, As Arduino Mega has 2 SDA SCL ports i was thinking to incorporate 2 or more MPUs in 1 arduino. Can you guide me how to modify the code so it reads both MPU data?

— Reply to this email directly or view it on GitHub https://github.com/rpicopter/ArduinoMotionSensorExample/issues/4.

hengyuliu123 commented 8 years ago

Hi,gregd72002 . I just use your modified files for my hardware. everything works well but there is a problem about fifo. The settled fifo rate could not higher than 200HZ, and if i set the rate at 200Hz , the output data is really at a low speed approximately 2 second could output a message. do you have any solutions for that?

hengyuliu123 commented 8 years ago

i discover that it is the i2c problem where quaternions would be 16 bits data , so how could i let i2c read 16 bits data from the fifo?

hengyuliu123 commented 8 years ago

sorry it's my fault, the problem is that sometime there will be no enough fifo packet to read and these caused some error roll data, do you have some solutions for that?

JackHamma commented 7 years ago

Hi, I'm using the I²C Multiplexer TCA9548A to read 6 MPU-9250 at once. You mentioned that we need to modify the open and update methods in mpu.cpp to pass an address. But I really can't figure out where this address is used, could you give me some hints? Thank you for sharing your great software!

stuermer6020 commented 6 years ago

Hi thanks for the awsome libary greg. Im also trying to get two mpus to work. I tried to pass the address to the update function and call the select device function. But unfortunately it doesent work. When pass the address in the setup it works. Thanks