When the sensor is completely covered (no light at all) a division by zero exception can occur.
The problem is in line 293 of the _P015_TLS2561.ino file.
Code: Select all
if( ch0/ch1 < 2 && ch0 > 4900)
Code: Select all
// ch1 out of range. the lux is not valid in this situation.
if (ch1 == 0) {
return -1;
}
// ch0 out of range, but ch1 not. the lux is not valid in this situation.
if( ch0/ch1 < 2 && ch0 > 4900) {