Add SCD40 sensor support#1746
Open
lkoehl wants to merge 1 commit into
Open
Conversation
Integrate SCD40 CO2/temperature/humidity sensor support across the project. Adds a new Scd40Sensor AST node and transformer visitor, updates SC constants and AstFactory to include CO2 mode, and introduces RobotMbed configuration/visitor hooks and toolbox entries. Also adds blockly UI/messages, configuration blocks, cross-compiler expected outputs (AST, collector results, and generated C++/Python) and a test XML program for Calliope targets so the sensor is available in the frontend and code generation for Calliope/CalliopeV3 is covered.
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.
Description
Integrates SCD40 CO2, temperature, and humidity sensor support for Calliope targets.
This change adds a new
Scd40SensorAST node, transformer visitor support, SC constants, CO2 mode handling, and AstFactory registration. It also wires the sensor into RobotMbed configuration, validation, code generation, Blockly blocks, messages, and toolbox entries so the SCD40 is available in the frontend for Calliope and Calliope V3.The Calliope C++ generator and Calliope V3 Python generator now emit SCD40 read logic for CO2, temperature, and humidity. The Calliope V3 helper initializes the external I2C bus for the A0 Grove connector and handles I2C read errors without crashing the user program.
Cross-compiler coverage was added via a new Calliope test program and expected AST, collector, C++, and Python outputs.
Fixes issue #1243
Dependencies:
None. Runtime use requires an SCD40 sensor connected to the Calliope Grove A0/I2C connector.
Type of change
How Has This Been Tested?
The following checks were run locally:
Manual runtime check: Generated and flashed a Calliope V3 Python program using the SCD40 CO2 sensor block. Serial output was used to inspect runtime behavior.
Test Configuration:
Checklist: