API Reference
adafruit_max44009
Author(s): Tim Cocks
Implementation Notes
Hardware:
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://circuitpython.org/downloads
Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
Adafruit’s Register library: https://github.com/adafruit/Adafruit_CircuitPython_Register
- class adafruit_max44009.CV
Constant-value helper for enum-like classes.
- class adafruit_max44009.IntegrationTime
Integration time settings for TIM bits [2:0] of CONFIG register.
In automatic mode (MANUAL=0), only the first four values (800ms-100ms) are available. The shorter integration times (50ms-6.25ms) require manual mode to be enabled.
Setting
Time
Notes
IntegrationTime.MS_800800 ms
Best low-light sensitivity
IntegrationTime.MS_400400 ms
IntegrationTime.MS_200200 ms
IntegrationTime.MS_100100 ms
Default, best high-bright
IntegrationTime.MS_5050 ms
Manual mode only
IntegrationTime.MS_2525 ms
Manual mode only
IntegrationTime.MS_12_512.5 ms
Manual mode only
IntegrationTime.MS_6_256.25 ms
Manual mode only
- class adafruit_max44009.MAX44009(i2c_bus: I2C, address: int = _MAX44009_DEFAULT_ADDRESS)
CircuitPython driver for the MAX44009 ambient light sensor.
- Parameters:
- current_division_ratio
Current division ratio. When True, only 1/8 of photodiode current is used, extending measurement range for very bright conditions.
- property integration_time: int
The integration time. Must be an
IntegrationTimevalue.Integration times shorter than 100ms require manual mode to be enabled.
- interrupt_enabled
Enable or disable the interrupt. True to enable.
- interrupt_status
True if an interrupt event occurred. Reading clears the interrupt.
- property lux: float
Read the lux value with full 12-bit resolution.
Returns NaN if the sensor is in an overrange condition (exponent = 0x0F). Check
overrangeafter reading to detect saturation.
- threshold_timer
Threshold persist timer value (0-255). The interrupt triggers only if lux stays outside the threshold window for (value * 100ms).
- class adafruit_max44009.Mode
Operating mode settings for CONT (bit 7) and MANUAL (bit 6) of CONFIG.
Setting
CONT
MANUAL
Description
Mode.DEFAULT0
0
Auto, 800ms cycle
Mode.CONTINUOUS1
0
Auto, fast updates
Mode.MANUAL0
1
Manual, 800ms cycle
Mode.MANUAL_CONTINUOUS1
1
Manual, fast