Skip to main content

A CircuitPython library for the VCNL4040 proximity and ambient light sensor.

Project description

Introduction

Documentation Status Discord Build Status Code Style: Ruff

A CircuitPython library for the VCNL4040 proximity and ambient light sensor.

Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.

Installing from PyPI

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:

pip3 install adafruit-circuitpython-vcnl4040

To install system-wide (this may be required in some cases):

sudo pip3 install adafruit-circuitpython-vcnl4040

To install in a virtual environment in your current project:

mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install adafruit-circuitpython-vcnl4040

Usage Example

import time
import board
import adafruit_vcnl4040

i2c = board.I2C()
sensor = adafruit_vcnl4040.VCNL4040(i2c)

while True:
    print("Proximity:", sensor.proximity)
    print("Light:", sensor.light)
    print("White:", sensor.white)
    time.sleep(0.3)

Documentation

API documentation for this library can be found on Read the Docs.

For information on building library documentation, please check out this guide.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

adafruit_circuitpython_vcnl4040-1.2.23.tar.gz (24.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file adafruit_circuitpython_vcnl4040-1.2.23.tar.gz.

File metadata

File hashes

Hashes for adafruit_circuitpython_vcnl4040-1.2.23.tar.gz
Algorithm Hash digest
SHA256 3e9b568914bf1bb11d1381ce239bcd835948e278aeeea362bd25ef10dd70e546
MD5 6541c823b05cb41b5bdb108dba5a7676
BLAKE2b-256 9da8b8091b634a62068462db662c515c75fa20a3e59cfd20331e605fc1031366

See more details on using hashes here.

File details

Details for the file adafruit_circuitpython_vcnl4040-1.2.23-py3-none-any.whl.

File metadata

File hashes

Hashes for adafruit_circuitpython_vcnl4040-1.2.23-py3-none-any.whl
Algorithm Hash digest
SHA256 287b47ceacdae7ef732ffa971d4ca99a2b564f07714734076d2b1f64f1d4106f
MD5 4058db9c50d0d280af0071a80644d89a
BLAKE2b-256 7a8dcb70b56382544f9cb53a41254596559bb365e5f727b480ec6855a9fcb541

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page