Skip to content

Add start low power periodic measurement #6

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

Merged
merged 2 commits into from
Aug 24, 2021

Conversation

enosh
Copy link
Contributor

@enosh enosh commented Aug 20, 2021

Saw this command in the data sheet and wanted to use it.
The function name is start_low_periodic_measurement instead of start_low_power_periodic_measurement to fit the length pylint wants.

Tested with a Feather RP2040 and the new SCD40 STEMMA QT breakout. Around 30 seconds between measurements.
Screen Shot 2021-08-19 at 23 06 48

First time submitter! Hope I'm not missing anything.

@kattni
Copy link
Contributor

kattni commented Aug 20, 2021

@enosh Thanks for your contribution! I am working with this sensor and will test it either today or Tuesday. Running CI now, which will verify syntax and formatting, etc.

@kattni kattni requested review from kattni and a team August 20, 2021 16:02
@ladyada
Copy link
Member

ladyada commented Aug 20, 2021

didnt test but lgtm

Copy link
Contributor

@KeithTheEE KeithTheEE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I double checked the datasheet just to verify the _SCD4X_STARTLOWPOWERPERIODICMEASUREMENT hex of 0x21AC is correct. The command is correct, but in the datasheet it says there's no delay needed after the command is sent.

Is there a reason you added a delay of 0.01s?

@enosh
Copy link
Contributor Author

enosh commented Aug 24, 2021

I used start_periodic_measurement for reference which also has no delay specified in the datasheet. Just tested both without a delay and it doesn't seem to make a difference. But I assume a delay wouldn't hurt, right?

Copy link
Contributor

@KeithTheEE KeithTheEE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that's the reasoning, then I'd err on the side of following the datasheet, and not having a delay. My main motivation is because I usually use datasheets as my mental 'square one' so if I have a bug I can't easily solve, I go back to that to make sure I can follow along with the code.

While you're right, a delay doesn't hurt unless you're doing really time sensitive stuff, the sensor reads have a built in delay with if scd4x.data_ready, so I think it is safe to remove this delay in favor of keeping with the sensor's datasheet.

Outside of that, awesome PR! Thank you!

Copy link
Contributor

@kattni kattni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again, @enosh. I agree with @CrakeNotSnowman on the delay. Please remove it, and if there are issues in the future, we have this discussion to fall back on.

Copy link
Contributor

@KeithTheEE KeithTheEE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That matches the datasheet as far as I'm able to tell.

Thank you for making these additional changes! I really appreciate it!

Copy link
Contributor

@kattni kattni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for adding this. @enosh!

@kattni kattni merged commit a482288 into adafruit:main Aug 24, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Aug 25, 2021
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.

4 participants