-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add TSL2561 sensor #7675
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
base: master
Are you sure you want to change the base?
Add TSL2561 sensor #7675
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 adds support for the TSL2561 digital light sensor to the Meshtastic telemetry system. The implementation includes sensor detection, initialization, and data collection for lux measurements.
Key changes:
- New TSL2561Sensor class implementation with proper initialization and metric collection
- Updated I2C device detection to differentiate between TSL2561 and TSL2591 sensors sharing the same address
- Integration with the EnvironmentTelemetry module for automatic sensor polling and data reporting
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
src/modules/Telemetry/Sensor/TSL2561Sensor.h | Header file defining the TSL2561Sensor class interface |
src/modules/Telemetry/Sensor/TSL2561Sensor.cpp | Implementation of TSL2561 sensor functionality including setup and metric collection |
src/modules/Telemetry/EnvironmentTelemetry.cpp | Integration of TSL2561 sensor into the telemetry polling and data collection system |
src/main.cpp | Registration of TSL2561 device type for I2C scanning |
src/detect/ScanI2CTwoWire.cpp | Enhanced I2C detection logic to distinguish TSL2561 from TSL2591 sensors |
src/detect/ScanI2C.h | Added TSL2561 device type enumeration |
protobufs | Updated protobuf submodule reference |
platformio.ini | Added Adafruit TSL2561 library dependency |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@davide125 can you resolve the conflicts in the protobufs submodule ref? I updated master with the changes |
Thanks! I've pushed a commit to update protobufs now, I can also squash everything if that makes for an easier merge, just let me know. |
Hi @davide125 , we'll squash on merge, so no need to do that :) Are you familar with the trunk code linter? we use that to keep our formatting consistent. If you use vscode you can just add the plugin and will automatically fix everything up. |
Ah, I don't use vscode but I've installed trunk and done a pass with it now, just pushed a fix for the issue it found. |
Add support for the TSL2561 light sensor. Related protobufs PR: meshtastic/protobufs#756
🤝 Attestations