adafruit / Adafruit_CircuitPython_SCD30

Helper library for the SCD30 e-CO2 sensor
MIT License
15 stars 10 forks source link

New measurement interval only starts after old interval completes #35

Closed rdlaner closed 1 year ago

rdlaner commented 1 year ago

I'm using the MagTag to read data from an SC30. The application changes the SCD30's measurement interval to a long period (2 min) while in deep sleep and then after the MagTag wakes up, it changes the measurement interval back to 2 seconds to read a few samples.

What I've found is that after I set the measurement interval of the SCD30 back to 2 seconds on wake, the new interval does not go into effect until the previous long interval of 2 min has fully completed. This is kind of annoying and makes timing difficult since I don't have the data ready pin wired up.

Does anyone know if this is by design and if there is any way to force a new measurement interval to take effect immediately?

rdlaner commented 1 year ago

I found a work-around. If you first stop continuous measurement, then change the measurement interval, and finally restart continuous measurement, then the new measurement interval will be enacted right away.