Datasheet
Table Of Contents

adafruit_tsl2591.GAIN_MED - 25x gain (the default)
adafruit_tsl2591.GAIN_HIGH - 428x gain
adafruit_tsl2591.GAIN_MAX - 9876x gain
integration_time - Set the integration time of the sensor to a value of:
adafruit_tsl2591.INTEGRATIONTIME_100MS - 100ms (the default)
adafruit_tsl2591.INTEGRATIONTIME_200MS - 200ms
adafruit_tsl2591.INTEGRATIONTIME_300MS - 300ms
adafruit_tsl2591.INTEGRATIONTIME_400MS - 400ms
adafruit_tsl2591.INTEGRATIONTIME_500MS - 500ms
adafruit_tsl2591.INTEGRATIONTIME_600MS - 600ms
That's all there is to using the TSL2591 sensor with CircuitPython!
Below is a complete example that will print the light level every second. Save this as main.py on the board and view
the output in the REPL (be sure to modify the code to use bitbangio if necessary for your board!):
sensor.gain = adafruit_tsl2591.GAIN_LOW
sensor.integration_time = adafruit_tsl2591.INTEGRATIONTIME_200MS
© Adafruit Industries https://learn.adafruit.com/adafruit-tsl2591 Page 22 of 24