-
Notifications
You must be signed in to change notification settings - Fork 24
Initial implementation of VEML6031X00 with unit tests #329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces support for the VEML6031X00 ambient light sensor family (VEML6031/VEML6030). The implementation follows the repository's hardware manager pattern and provides a low-level driver using direct I2C register access, mirroring the behavior of the Zephyr driver with support for single-shot measurement mode and data-ready polling.
Key Changes
- Added
VEML6031x00Managerclass that implements theLightSensorProtoprotocol with direct I2C register manipulation - Implemented single-shot measurement using active force mode with configurable gain, integration time, and photodiode size settings
- Added comprehensive unit test suite with 839 lines covering initialization, configuration, measurements, error handling, and I2C communication patterns
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
circuitpython-workspaces/flight-software/src/pysquared/hardware/light_sensor/manager/veml6031x00.py |
New driver implementation with I2C register access, resolution calculation, and error handling |
cpython-workspaces/flight-software-unit-tests/src/unit-tests/hardware/light_sensor/manager/test_veml6031x00_manager.py |
Comprehensive test suite covering all public methods and edge cases |
...python-workspaces/flight-software/src/pysquared/hardware/light_sensor/manager/veml6031x00.py
Show resolved
Hide resolved
...python-workspaces/flight-software/src/pysquared/hardware/light_sensor/manager/veml6031x00.py
Show resolved
Hide resolved
...python-workspaces/flight-software/src/pysquared/hardware/light_sensor/manager/veml6031x00.py
Show resolved
Hide resolved
...python-workspaces/flight-software/src/pysquared/hardware/light_sensor/manager/veml6031x00.py
Show resolved
Hide resolved
...python-workspaces/flight-software/src/pysquared/hardware/light_sensor/manager/veml6031x00.py
Show resolved
Hide resolved
| logger = Logger() | ||
| i2c = initialize_i2c_bus(logger, board.SCL, board.SDA, 100000) | ||
| sensor = VEML6031x00Manager(logger, i2c) | ||
| lux = sensor.get_lux() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for the contribution! The open source marches on



Summary
This PR implements the base functionality of the VEML6031X00 light sensor.
How was this tested