MakingThingsTalk2 icon indicating copy to clipboard operation
MakingThingsTalk2 copied to clipboard

No need to wait after Wire.requestFrom()

Open Koepel opened this issue 8 years ago • 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.

Koepel avatar Aug 20 '17 13:08 Koepel