jrowberg / i2cdevlib

I2C device library collection for AVR/Arduino or other C++-based MCUs
http://www.i2cdevlib.com
3.88k stars 7.52k forks source link

MPU6050 not working with TTGO T-Display #629

Open jppboi opened 2 years ago

jppboi commented 2 years ago

I have an MPU6050 connected to my T-Display with DMP6. The raw example works fine but DMP6 doesn't connect. I have the interrupt pin connected to pin 2. I don't know if the interrupts are different on the T-display, or if there is another problem. How should I fix it?

ZHomeSlice commented 2 years ago

just request DMP FIFO data every 10ms using you don't need to use interrupts any more. although it will be more accurate by less than 10ms if you check on interrupt. Funciton prototype: uint8_t MPU6050::dmpGetCurrentFIFOPacket(uint8_t *data);// overflow proof

usage example:

uint8_t fifoBuffer[64]; // FIFO storage buffer
if(mpu.dmpGetCurrentFIFOPacket(fifoBuffer)){
    // you've got new data in fifoBuffer
}

Z

jppboi commented 2 years ago

It might not be an interrupt issue though because it doesn't even connect before initializing dmp.