I2C shenanigans

Hey!

I am currently trying to figure out how to work with I2C since I don't find working with libraies without knowing how the backend works very interesting. Now I have stumbled across some problems/questions which I hope you can help me out with.

1.) Can I read more than one register at once? Meaning can I send two adresses and then request 2 bytes worth of response?

2.) In the documentation of my sensor is says: "UT = MSB << 8 + LSB" with MSB and LSB being registries. I can't figure out what "<<" is...

3.) It also says that I have to wait 4.5ms between writing the command to determine the temperature and reading the result from the respective registry. Do I have to use a delay here? Does it matter if I wait much longer than that?

Thank you a ton for your answers in advance (=

Hi,

  1. I don't think you can read more than one register at once.

  2. << means shifting bits to the left. In this example the MSB byte is shifted 8 positions to the left and LSB is added. So the UT variable (which is an integer I suppose) will contain the MSB in the left 8 bits and the LSB in the right eight bits.

3)delay(5); will be fine,

Thank you! You helped me out a lot (=