Jump to content
I2Cdevlib Forums

Setting sampling rate fails by using mpu6050.h


Recommended Posts

Hello all,

 

I have a mpu 9150 IMU sensor, Arduino DUE and I am using mpu6050.h to get IMU data.

 

I have used MPU6050::setRate function to set different sampling rate (0~244) and it was verified by using MPU6050::getRate function. However, when I use below codes to check sampling rate of getMotion9 function, the rate always keep around 40Hz:

 

 mytime_pre=micros();

 MPU6050.getMotion9(&ax, &ay, &az, &gx, &gy, &gz, &mx, &my, &mz);

 mytime=micros();  

 sample_rate=mytime-mytime_pre

 

As far as I know, the sampling rate can be far more than 40Hz (I have disabled the low pass filter by using setDLPFMode(0). Did I do anything wrong while setting up sampling rate?

 

Thanks you in advanced.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...