adafruit / Adafruit_TSL2591_Library

This is an Arduino library for the TSL2591 digital luminosity (light) sensors.
58 stars 48 forks source link

make calculateLux return a float #9

Closed gtalusan closed 6 years ago

gtalusan commented 7 years ago

calculateLux is a ratio of VIS to IR channels with some constants thrown in. All of the calculations are done in float, but the fractional component is thrown away at the end with a cast to uint32_t. The TSL2591 is able to measure down to 188 uLux so let's make it return a float and change the example to print out some more decimals.

rwijngaa commented 7 years ago

Thanks for your PR.

ladyada commented 6 years ago

done! thankx!