In the file "openag-firmware/lib/tsl2561/tsl2561.cpp", there is a timeout with millis() in the function "readRegister()". You may remove that.
Explanation: Common-mistakes#1
The returned error code from Wire.endTransmission() is not handled, therefor you might read data without checking for errors as well. But if you still want to check if data was received, you could do this:
Wire.requestFrom(deviceAddress, 1); // read a byte
if (Wire.available() != 1) {
return 0;
}
value = Wire.read();
return value;
In the file "openag-firmware/lib/tsl2561/tsl2561.cpp", there is a timeout with millis() in the function "readRegister()". You may remove that. Explanation: Common-mistakes#1
The returned error code from Wire.endTransmission() is not handled, therefor you might read data without checking for errors as well. But if you still want to check if data was received, you could do this: