Overview

Driver for an AMS TSL2561 ambient light sensor.

Resources

All correct at time of writing, but as always, manufacturers love to move things around on their website.

Web page

http://www.ams.com/eng/Products/Light-Sensors/Ambient-Light-Sensor-ALS/TSL2561

Datasheet

http://www.ams.com/eng/content/download/250093/975477/142937

Test hardware

This code has been tested using a JeeLabs Lux Plug:

http://jeelabs.com/products/lux-plug

This was installed on a JeeLabs Plug Shield:

http://jeelabs.com/products/plug-shield

And finally installed on a SolderCore:

http://soldercore.com/products/soldercore/

API Summary

Constants
TSL2561_I2C_ADDR_FLOAT TSL2561 8-bit I2C address for ADDRSEL floating
TSL2561_I2C_ADDR_GND TSL2561 8-bit I2C address for ADDRSEL grounded
TSL2561_I2C_ADDR_VDD TSL2561 8-bit I2C address for ADDRSEL tied to Vdd
Types
TSL2561_DRIVER_t TSL2561 light sensor
Functions
tsl2561_initialize_i2c Initialize sensor on I2C bus
tsl2561_set_integration_time Set sensor integration time