The LTR329ALS01 is a dual light sensor that provides outputs for external light levels in lux. See the datasheet for more information about the wavelengths of the two sensors.
Creates a LTR329ALS01 object. Constructor must be passed a Pycoproc or I2C object to successfully construct. The additional arguments are:
gain
: The light sensor ADC gain. see the Constants for valuesintegration
: Controls the integration time of the periodic measurement. See the Constants for valuesrate
: The used sample rate in ms, must be set larger than the integration period. See the Constants for valuesRead the light levels of both light sensors. Returns a tuple with two values for light levels: (blue, red)
, between 0-65535.
Calculate the illuminance using the readings of the light sensor. Returns a single value in lux.
The following arguments may be passed into the constructor.
ALS_GAIN_1X
,ALS_GAIN_2X
, ALS_GAIN_4X
, ALS_GAIN_8X
, ALS_GAIN_48X
, ALS_GAIN_96X
ALS_INT_50
, ALS_INT_100
, ALS_INT_150
, ALS_INT_200
, ALS_INT_250
, ALS_INT_300
, ALS_INT_350
, ALS_INT_400
ALS_RATE_50
, ALS_RATE_100
, ALS_RATE_200
, ALS_RATE_500
, ALS_RATE_1000
, ALS_RATE_2000