adafruit_ltr329_ltr303

Python driver for LTR-329 and LTR-303 ight sensor

  • Author(s): ladyada

Implementation Notes

Hardware:

Software and Dependencies:

class adafruit_ltr329_ltr303.LTR303(i2c: I2C, address: int = 41)

Base driver for the LTR-303 light sensor, basically an LTR-329 with INT out

Parameters:
  • i2c_bus (I2C) – The I2C bus the sensor is connected to.

  • address (int) – The I2C device address. Defaults to 0x29

property enable_int: bool

Enable the interrupt functionality.

property int_persistence: int

How long the data needs to be high/low to generate an interrupt. Setting of 1 means ‘every measurement’, 2 means “two in a row”, etc up to 16

property int_polarity: bool

The polarity of the interrupt (whether high or low is “active”)

class adafruit_ltr329_ltr303.LTR329(i2c: I2C, address: int = 41)

Base driver for the LTR-329 light sensor.

Parameters:
  • i2c_bus (I2C) – The I2C bus the sensor is connected to.

  • address (int) – The I2C device address. Defaults to 0x29

property als_data_gain: int

ALS gain for data that is being read now, can be: 1, 2, 4, 8, 48 or 96 times

property als_gain: int

1, 2, 4, 8, 48 or 96 times

Type:

ALS gain, can be

property integration_time: int

50, 100, 150, 200, 250, 300, 350, or 400 milliseconds

Type:

ALS integration times, can be

property ir_light: int

The IR light data

property light_channels: Tuple[int, int]

A data pair of both visible+IR light, and the IR-only light

property measurement_rate: int

ALS measurement rate, must be = or > than ALS integration rate! Can be: 50, 100, 200, 500, 1000, or 2000 milliseconds

reset() None

Reset the sensor to the default state set by the library

throw_out_reading() None

Throw out a reading (typically done to clear it out)

property visible_plus_ir_light: int

The visible + IR light data