sparkfun / SparkFun_HTU21D_Breakout_Arduino_Library

HTU21D Breakout Arduino Library
Other
31 stars 23 forks source link

Fix wrong behaviour if the last iteration provide valid data #5

Closed Wohlie closed 7 years ago

Wohlie commented 7 years ago

The last read in the for loop of the readValue method is always interpreted as ERROR_I2C_TIMEOUT even valid data are available.

This is easy testable if the constant DELAY_INTERVAL will set to 100. In this case only one iteration of the loop will performed. Without this fix the method readValue will always return ERROR_I2C_TIMEOUT. With this fix the behaviour depends of the availability of the data.

MPParsley commented 7 years ago

I've noticed some ERROR_I2C_TIMEOUT from time to time. Any reason this hasn't been merged back yet?

nseidle commented 7 years ago

I apologize, I missed the notification of this pull request. Looks good! Thank you @Wohlie.