Initial implementation of VEML6031X00 with unit tests#329
Merged
ChristopherPrainito merged 1 commit intomainfrom Nov 18, 2025
Merged
Initial implementation of VEML6031X00 with unit tests#329ChristopherPrainito merged 1 commit intomainfrom
ChristopherPrainito merged 1 commit intomainfrom
Conversation
|
Contributor
There was a problem hiding this comment.
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
Mikefly123
approved these changes
Nov 18, 2025
| logger = Logger() | ||
| i2c = initialize_i2c_bus(logger, board.SCL, board.SDA, 100000) | ||
| sensor = VEML6031x00Manager(logger, i2c) | ||
| lux = sensor.get_lux() |
Member
There was a problem hiding this comment.
LGTM! Thanks for the contribution! The open source marches on
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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