TSL2561 Light Sensor driver for the ESP8266 platform
C C++
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
driver initial commit Jul 8, 2015
include/driver initial commit Jul 8, 2015
README.md initial commit Jul 8, 2015


ESP8266 TSL2561 Driver

Driver Library for the TAOS TSL2561 light sensor.

The TLS2561 is an i2c device with two diode sensors and intgrated ADCs for measuring diode response. One diode measures broadband light spectrum while the other measures infrared spectrum light only. Subtracting the IR response from the Broadband response gives an approximation of human-eye response.


In user_init call:



Note: Use TSL2561_ADDR_L or TSL2561_ADDR_H if your device address pin is connected to VCC or GND

To get a reading in Lux:

uint32 lux = TSL2561_getLux(TSL2561_ADDR_F);

To set Gain or Integration Time:

TSL2561_writeByte(TSL2561_ADDR_F, TSL2561_REGISTER_TIMING, TSL2561_INTEG_13_7MS | TSL2561_GAIN_X16);

See TSL2561_register.h for a full list of register names and options.

See i2c.h to set the GPIO pins for i2c. Default is SCK = GPIO0, SDA = GPIO2.