You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having a weird problem with my I2C code. The problem is that when I try to read only 1 byte in the master I get 0xFF but if I read 2 bytes I get proper value of the first byte.
Wire.requestFrom(SLAVE_ADDRESS, 1);
data = Wire.read();
I am having a weird problem with my I2C code. The problem is that when I try to read only 1 byte in the master I get 0xFF but if I read 2 bytes I get proper value of the first byte.
Wire.requestFrom(SLAVE_ADDRESS, 1); data = Wire.read();
=> gives
data
as0xFF
Wire.requestFrom(SLAVE_ADDRESS, 2); data0 = Wire.read(); data1 = Wire.read();
=> gives
data0
as0xA5
(which is expected from the single byte read)Am I doing anything wrong?
The text was updated successfully, but these errors were encountered: