Jump to content
I2Cdevlib Forums


  • Posts

  • Joined

  • Last visited

Reputation Activity

  1. Like
    Zeta.Investigator reacted to luisrodenas in DMP polling (no interrupt/FIFO)   
    YES, try to use DMP, check the example DMP sketch and adapt it to your project.
    I believe you can work without the interruptions, but you will need to read the fifo buffer at least at the same frecuency (I recommend higher) that the DMP is working.
    You can change DMP's frecuency to your needs. If you read at lower frecuency it will overflow and start giving errors.
    Just mopdify the example sketch and erase the interruption part, put a delay to get the frecuency you want (just to try) and check that it works.
    If using DMP you will also need to calibrate your MPU.
  2. Like
    Zeta.Investigator reacted to Jeff Rowberg in A question to change the sample rate in MPU6050.h file   
    Hi guys,
    The setRate() method only applies to raw measurements, but not to the DMP which has its own rate. This is defined on line 261 (currently) of MPU6050_6Axis_MotionApps_20.h. The default rate is 100Hz (the last byte is 0x01), but you can increase it to 50Hz by changing that byte to 0x03 instead. To the best of my knowledge, the internal sensors are still read at a very fast rate, but the DMP algorithms compensate such that the output data is appropriate for 50Hz intervals.
    If you don't want to use the interrupt pin (which is a shame since it's much more efficient), you can simply poll regularly for a FIFO count that is >= 42 (which is the size of a typical MotionApps 2.0 DMP packet), and read those 42 bytes anytime they are available until there are less than 42 bytes available. It's kind of an ugly way to do it, but it does work as long as you read fast enough that the FIFO doesn't overflow (>= 1024 bytes).
  • Create New...