To use this sensor and calculate Lux, there's a lot of very hairy and unpleasant math. You can check out the math in the datasheet but really, its not intuitive or educational - its just how the sensor works. So we took care of all the icky math and wrapped it up into a nice Arduino library.
Install Adafruit_TSL2561 library
To begin reading sensor data, you will need to install the Adafruit_TSL2561 library (code on our github repository). It is available from the Arduino library manager so we recommend using that.
From the IDE open up the library manager...
And type in adafruit tsl2561 to locate the library. Click Install
You will also need the Adafruit Sensor Library if you do not already have it installed.
Search the library manager for Adafruit Unified Sensor and install that too (you may have to scroll a bit)
Now you can run the File->Examples->Adafruit_TSL2561->sensorapi example program which will read and calculate the lux readings for you.
Open up the serial monitor at 9600 baud to see the measurements. Use a lamp or your hand to illuminate/shade the sensor to see the values change.
Upload the example sketch to your Flora.
Text editor powered by tinymce.