API Reference
adafruit_vcnl4020
Driver for the VCNL4020 proximity and light sensor
Author(s): Liz Clark
Implementation Notes
Hardware:
Adafruit VCNL4020 Proximity and Light Sensor <https://www.adafruit.com/product/5810>
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_vcnl4020.Adafruit_VCNL4020(i2c: busio.I2C, addr: int = _I2C_ADDRESS)
Adafruit VCNL4020 Proximity/Ambient Light sensor driver
Initializes the VCNL4020 sensor and checks for a valid Product ID Revision. :param i2c: The I2C interface to use :param addr: The I2C address of the VCNL4020, defaults to _I2C_ADDRESS
- auto_offset_comp
Auto offset compensation for ambient light measurement.
- property clear_interrupts: None
Clears the interrupt flags.
- Parameters:
value – True to clear all interrupt flags.
- continuous_conversion
Continuous conversion mode for ambient light measurement.
- high_threshold
Sets the high threshold for proximity measurement.
- high_threshold_interrupt
Enable/disable proximity high threshold interrupt
- property led_current: int
The LED current for proximity mode in mA.
- Returns:
The LED current in mA.
- low_threshold
Sets the low threshold for proximity measurement
- low_threshold_interrupt
Enable/disable proximity low threshold interrupt
- lux
Reads the ambient light/lux sensor (ALS) measurement result
- lux_enabled
Enable/disable lux sensor
- lux_interrupt
Enable/disable lux interrupt
- lux_on_demand
On-demand setting for lux measurements
- lux_ready
Status of ambient light data
- proximity
Reads the proximity measurement result
- proximity_enabled
Enable/disable proximity sensor
- proximity_interrupt
Enable/disable proximity interrupt
- proximity_on_demand
On-demand setting for proximity measurements
- proximity_ready
Status of proximity data.
- selftimed_enabled
Enable/disable selftimed reading