adafruit_vcnl4020

Driver for the VCNL4020 proximity and light sensor

  • Author(s): Liz Clark

Implementation Notes

Hardware:

Software and Dependencies:

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 interrupt_count: int

Interrupt count setting

Return type:

int

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

property lux_averaging: int

Ambient averaging sample rate

Return type:

int

lux_enabled

Enable/disable lux sensor

lux_interrupt

Enable/disable lux interrupt

lux_on_demand

On-demand setting for lux measurements

property lux_rate: int

Ambient light measurement rate

Return type:

int

lux_ready

Status of ambient light data

promixity_on_demand

On-demand setting for proximity measurements

proximity

Reads the proximity measurement result

proximity_enabled

Enable/disable proximity sensor

property proximity_frequency: int

Proximity frequency setting

Return type:

int

proximity_interrupt

Enable/disable proximity interrupt

property proximity_rate: int

Proximity measurement rate

Return type:

int

proximity_ready

Status of proximity data.

selftimed_enabled

Enable/disable selftimed reading