Hi all,
I have been using Jeff's MPU6050 Arduino library with great results. However, in my current project, I want to put getAccelerationX() (or getMotion6() for that matter) inside an IRS (ISR(TIMER2_COMPA_vect) specifically) in order to poll the MPU6050 at precise intervals (about 60Hz). But for some reason the code will hang inside the function getAccelerationX(). Is this some kind of interrupt conflict? I would like to know if there is anyway to work around this.
For a quick reference, this is the code of getAccelerationX():
int16_t MPU6050::getAccelerationX() { I2Cdev::readBytes(devAddr, MPU6050_RA_ACCEL_XOUT_H, 2, buffer); return (((int16_t)buffer[0]) << 8) | buffer[1]; }
I am using a standalone Arduino UNO, with timer0 untouched, and timer1 already used to control some motors. Will it work if I use an AVR with more timers (3,4,5) and use one of those instead of timer2 above? Thanks in advance,
Dave