Skip to content
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

SCD41 CO2 sensor example #24

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MichaelBell
Copy link
Collaborator

I quickly ported the CO2 sensor example from PicoVision.

@exussum12
Copy link
Contributor

exussum12 commented Jan 7, 2025

The error handling doesnt work too well currently

loop = False
try:
    breakout_scd41.init(i2c)
    breakout_scd41.start()
    vector.text("Waiting for sensor to be ready", 0, 50)
    presto.update()
    breakout_scd41.ready()
    loop = True
except Exception as e:
    print(f"Error waiting for sensor: {e}")
    vector.set_font("osansb.af", 25)
    vector.text("SCD41 breakout not detected :(", 0, 50)
    vector.text("but you could buy one at pimoroni.com ;)", 0, HEIGHT - 120)
    presto.update()

while loop:

Replacing the top section with that seems to work much better for me. Main issues are crashing further down, the error not being clear

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.

2 participants