I have a question regarding a piece of code I’ve written. I added something I googled in order to get it to work but I don’t know why I need that to get it to work.
Wire.beginTransmission(0x10); Wire.write(5); >>>>Wire.endTransmission(false);<<<< Wire.requestFrom(0x10, 2); data = Wire.read(); data |= Wire.read() << 8; Wire.endTransmission();
Without the indicated part it won’t work and just output 0, and I do not understand why.
Page 4 of the spec sheet shows you the frame in order to read the data.
Is endTransmission(false) doing the Start condition again? Isn’t requestFrom(Address, Bytes, STOP) sending a start condition as well?
Hopefully someone can explain, thanks in advance.