adafruit / Adafruit_TSL2561

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

Changed return value of getEvent and value of event.light in case of saturation #3

Closed beegee-tokyo closed 8 years ago

beegee-tokyo commented 8 years ago

Current version of the library returns 0 in event.light in case of saturation. As a value of 0 could be a valid value in absolute darkness (tested by me) it is better to return a value > 65535 to report saturation and return false from getEvent in that case!

This change request returns 65536 (1 more than max possible value) and false from getEvent in case of saturation.

Successfully tested in my own application and backward compatible.