cschou100 Posted July 22, 2016 Report Share Posted July 22, 2016 Recently, when I tried to control MPU6050 via Mediatek Linkit One, I found that there seems a problem in readBytes() function in i2cdevlib. Since the I2C buffer of Linkit One is really small, the following code will loop more than one time. Using logic analyzer, I found that the I2C write address will be incorrect after first iteration because of the line 278. Will you guys think that the line 278 needs to be modified to Wire.write(regAddr+k) ? PS. The DMP operates correctly after this modification. 276 for (uint8_t k = 0; k < length; k += min(length, BUFFER_LENGTH)) { 277 Wire.beginTransmission(devAddr); 278 Wire.write(regAddr); 279 Wire.endTransmission(); 280 Wire.beginTransmission(devAddr); 281 Wire.requestFrom(devAddr, (uint8_t)min(length - k, BUFFER_LENGTH)); 282 Thanks lapedNok 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.