Skip to content

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

@MichaelBell MichaelBell mentioned this pull request Jul 16, 2025
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