Page 1 of 1

Issues in using MPU9250 with Fusion in async method

Posted: Mon Apr 30, 2018 11:19 am
by nikhiledutech
Hey,

I am using async method to display data of roll, pitch, heading on LCD. Currently the Fusion module is created using MPU9150. I have used fusion.py in sync method with MPU9250 and it works fine.

But in async method, it gives me error of MPU9250 don't have mag_trigger. In 9150, mag_reading is used Initiate a mag reading.


So what if i replace mag_reading with "" imu.mag.xyz "".

Code: Select all

async def read_coro():
    imu.mag.xyz
    await asyncio.sleep_ms(20)  # Plenty of time for mag to be ready
    return imu.accel.xyz, imu.gyro.xyz, imu.mag.xyz



When i replace the above code, it give me data but its not getting updated after one reading.

Re: Issues in using MPU9250 with Fusion in async method

Posted: Tue May 01, 2018 9:40 am
by pythoncoder
The two chips are different. The MPU9250 takes readings continuously so the driver for it doesn't need a mag_trigger function. The older MPU9150 needs to be triggered to take a reading. So you must use the right driver for the chip in use.

From your description it's not clear what is causing this error. It would help if you gave code and the exact error message you're getting.

Re: Issues in using MPU9250 with Fusion in async method

Posted: Tue May 01, 2018 9:55 am
by nikhiledutech
Sorry was using wrong driver file. :oops: