drivers.TSL2591.TSL2591¶
Oizom wrapper driver for the AMS TSL2591 ambient light sensor.
Provides a simplified, Oizom-flavoured facade over the vendored Adafruit
CircuitPython TSL2591 library. Initialises the device over I2C, exposes
gain and integration-time selectors, and surfaces a single
get_current() call returning lux, full-spectrum, and infrared
luminosity in one structured response. All hardware faults are captured
via utils.oizom_logger.OizomLogger rather than raised.
Example
>>> from drivers.TSL2591.TSL2591 import TSL2591
>>> sensor = TSL2591(port=1)
>>> sensor.set_gain(sensor.GAIN_MED)
>>> sensor.set_timing(sensor.INTEGRATIONTIME_100MS)
>>> reading = sensor.get_current()
>>> reading["lux"], reading["full"], reading["ir"]
(123.4, 5678, 901)
Note
The TSL2591 lives on the I2C bus at fixed address 0x29. Supported
gain enums are GAIN_LOW (1x), GAIN_MED (25x), GAIN_HIGH
(428x) and GAIN_MAX (9876x). Integration time enums are
INTEGRATIONTIME_100MS through INTEGRATIONTIME_600MS in 100 ms
steps. The low-level register protocol is documented in the vendored
backend module drivers.TSL2591.adafruit_tsl2591.
See also
SensorBase.SensorBase.GenericSensor: Oizom abstract sensorcontract. This wrapper does not inherit from it but follows the same
get_currentreading convention.drivers.TSL2591.adafruit_tsl2591: Vendored Adafruit backendproviding the underlying I2C register-level driver.
Attributes¶
Classes¶
Oizom-side facade around the AMS TSL2591 light sensor. |
Module Contents¶
- drivers.TSL2591.TSL2591.basic_logger¶
- drivers.TSL2591.TSL2591.context_logger¶