winkj / arduino-sht

Unofficial repository for Sensirion Humidity and temperature sensor support on Arduino
2 stars 50 forks source link

No need to wait after Wire.requestFrom() #4

Closed Koepel closed 7 years ago

Koepel commented 7 years ago

There is a message that the code at Senserion should be used, but that is forked from this and I can not make an Issue there.

There is not need to wait after a Wire.requestFrom(). When the Wire.requestFrom() returns, the I2C transaction has completely finished and the received data is waiting in a buffer in the Wire library. There is no need for a delay, no need for a number of tries.

This incorrect use of the Wire library is at Senserion in SHTSensor.cpp, and here in shti2chelper.cpp.

winkj commented 7 years ago

Thanks for the change request, looks good to me. I added i minor request to the MR (removal of unused MAX_I2C_READ_TRIES constant), but it looks good otherwise

winkj commented 7 years ago

merged in Sensirion/arduino-sht