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.
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.