Skip to content

Conversation

@ChristopherPrainito
Copy link
Member

@ChristopherPrainito ChristopherPrainito commented Nov 18, 2025

Summary

This PR implements the base functionality of the VEML6031X00 light sensor.

How was this tested

  • Added new unit tests
  • Ran code on hardware (screenshots are helpful)
  • Other (Please describe)

@sonarqubecloud
Copy link

Copy link
Contributor

Copilot AI left a 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 VEML6031x00Manager class that implements the LightSensorProto protocol 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

logger = Logger()
i2c = initialize_i2c_bus(logger, board.SCL, board.SDA, 100000)
sensor = VEML6031x00Manager(logger, i2c)
lux = sensor.get_lux()
Copy link
Member

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

@ChristopherPrainito ChristopherPrainito merged commit 1ff96f0 into main Nov 18, 2025
10 checks passed
@ChristopherPrainito ChristopherPrainito deleted the veml6031x00 branch November 18, 2025 03:05
@Mikefly123 Mikefly123 mentioned this pull request Dec 1, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants