Jump to content
I2Cdevlib Forums

cschou100

Members
  • Posts

    1
  • Joined

  • Last visited

cschou100's Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. 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
×
×
  • Create New...