Seeed-Studio / Grove_Digital_Light_Sensor

TSL2561 & ISL29035
MIT License
13 stars 14 forks source link

Code is hanging in the dark #2

Closed slalaure closed 8 years ago

slalaure commented 8 years ago

In case of a totally dark night, the code will hang, because ch1 will be =0 and in the function read visibleLux() the code "if (ch0 / ch1 < 2 && ch0 > 4900)" will fail : div by 0 ... I suggest putting this code just above if(ch1 == 0) { return 0; }

KillingJacky commented 8 years ago

Hi @slalaure , thanks for reporting, already patched your code.