How do I read a specific register address?
Does this read starting from register address 0x00
Wire.requestFrom(6B, 3);
do I have to wait once while(Wire.available())
and then collect the data sequentially:
dataBuffer[0] = Wire.read();
dataBuffer[1] = Wire.read();
dataBuffer[2] = Wire.read();
while(Wire.available())
dataBuffer[0] = Wire.read();
while(Wire.available())
dataBuffer[1] = Wire.read();
while(Wire.available())
dataBuffer[2] = Wire.read();
to read from a specific register address (for example register 0x52) do I have to combine the read/write?
Wire.beginTransmission(0x6B);
Wire.write(0x52)
while(Wire.available())
dataBuffer[0] = Wire.read();
Wire.endTransmission();
or insert the request from also
Wire.beginTransmission(0x6B);
Wire.write(0x52)
Wire.requestFrom(6B, 1);
while(Wire.available())
dataBuffer[0] = Wire.read();
Wire.endTransmission();
and to put it all together, how would I read 3 bytes but starting at register address 0x52?
Thank you
Does this read starting from register address 0x00
Wire.requestFrom(6B, 3);
do I have to wait once while(Wire.available())
and then collect the data sequentially:
dataBuffer[0] = Wire.read();
dataBuffer[1] = Wire.read();
dataBuffer[2] = Wire.read();
while(Wire.available())
dataBuffer[0] = Wire.read();
while(Wire.available())
dataBuffer[1] = Wire.read();
while(Wire.available())
dataBuffer[2] = Wire.read();
to read from a specific register address (for example register 0x52) do I have to combine the read/write?
Wire.beginTransmission(0x6B);
Wire.write(0x52)
while(Wire.available())
dataBuffer[0] = Wire.read();
Wire.endTransmission();
or insert the request from also
Wire.beginTransmission(0x6B);
Wire.write(0x52)
Wire.requestFrom(6B, 1);
while(Wire.available())
dataBuffer[0] = Wire.read();
Wire.endTransmission();
and to put it all together, how would I read 3 bytes but starting at register address 0x52?
Thank you