adafruit / Adafruit_TSL2561

Unified sensor driver for Adafruit's TSL2561 breakouts
85 stars 77 forks source link

stops working after a while #2

Closed xseignard closed 6 years ago

xseignard commented 9 years ago

Hello,

I don't know why, but the sensor stops working (i.e. no more event.light == true) after a while.

Here is my sketch: https://gist.github.com/xseignard/2d4e00fd3a762d393606

The sketch still runs, but no more lux measures,

Any idea?

Regards,

Xavier

xseignard commented 9 years ago

So the problem is that, as opposed as it is written in the example, the sensor can actually return 0 lux. So if the sensors returns 0 it is not sure that it's a sensor overload.

Beeski commented 9 years ago

I experienced this as well. So I cached the last known non-zero value and returned that if the lux reading was zero. That way if the sensor suddenly finds it self in full sun then it just plateaus along until it gets another valid reading and doesn't just instantly drop to zero.

HTH

beegee-tokyo commented 8 years ago

I made a change to the library to get around this zero value problem. See my pull request https://github.com/adafruit/Adafruit_TSL2561/pull/3 The changed library is as well available in my fork https://github.com/beegee-tokyo/Adafruit_TSL2561

ladyada commented 6 years ago

oops this was merged and we didnt close. thanks!