tigoe/MakingThingsTalk2

No need to wait after Wire.requestFrom()

Opened this issue · 0 comments

In the file "MakingThingsTalk2/chapter9/project27/SonMicroFirmware/SonMicroFirmware.ino" these lines can be removed after the Wire.requestFrom():

  // don't do anything until new bytes arrive:
  while(!Wire.available()) {
    delay(50);
  }

There is nothing to wait for. When the Wire.requestFrom() returns, the I2C transaction has completely finished and the received data is waiting in a buffer in the Wire library.