Datasheet
Table Of Contents

Library Reference
The Adafruit_TSL2591 library contains a number of public functions to help you get started with this sensor.
Constructor
To create an instance of the Adafruit_TSL2591 driver, simple declare an appropriate object, along with a 32-bit numeric
value to identify this sensor (in case you have several TSL2591s and want to track them separately in a logging
system).
Gain and Timing
You can adjust the gain settings and integration time of the sensor to make it more or less sensitive to light, depending
on the environment where the sensor is being used.
The gain can be set to one of the following values (though the last value, MAX, has limited use in the real world given
the extreme amount of gain applied):
TSL2591_GAIN_LOW: Sets the gain to 1x (bright light)
TSL2591_GAIN_MEDIUM: Sets the gain to 25x (general purpose)
TSL2591_GAIN_HIGH: Sets the gain to 428x (low light)
TSL2591_GAIN_MAX: Sets the gain to 9876x (extremely low light)
Gain can be read or set via the following functions:
void setGain(tsl2591Gain_t gain);
tsl2591Gain_t getGain();
The integration time can be set between 100 and 600ms, and the longer the integration time the more light the sensor
is able to integrate, making it more sensitive in low light the longer the integration time. The following values can be
used:
TSL2591_INTEGRATIONTIME_100MS
TSL2591_INTEGRATIONTIME_200MS
TSL2591_INTEGRATIONTIME_300MS
TSL2591_INTEGRATIONTIME_400MS
TSL2591_INTEGRATIONTIME_500MS
TSL2591_INTEGRATIONTIME_600MS
The integration time can be read or set via the following functions:
void setTiming (tsl2591IntegrationTime_t integration);
tsl2591IntegrationTime_t getTiming();
An example showing how these functions are used can be seen in the code below:
Adafruit_TSL2591 tsl = Adafruit_TSL2591(2591);
© Adafruit Industries https://learn.adafruit.com/adafruit-tsl2591 Page 14 of 24