Open velechit opened 11 months ago
0xFF is one byte (0b11111111) in binary it's mean correct. can i get more information about the issue.
Wire.requestFrom(SLAVE_ADDRESS, 1);
while(Wire.available()) { // slave may send less than requested
data0 = Wire.read();
Serial.print(data0);
}
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.
=> gives
data
as0xFF
=> gives
data0
as0xA5
(which is expected from the single byte read)Am I doing anything wrong?