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

Use configurable readout delay #32

Open
avsaase opened this issue Dec 10, 2023 · 1 comment
Open

Use configurable readout delay #32

avsaase opened this issue Dec 10, 2023 · 1 comment

Comments

@avsaase
Copy link

avsaase commented Dec 10, 2023

The measurement time is hardcoded using a delay of 40ms:

delay.delay_ms(40).await.map_err(|_| Error::Delay)?; // await measurement

This limits the measurement rate to 25Hz, while both the BMP280 and BME280 datasheets say faster updates rates are supported when using lower oversampling and IIR values. Would it make sense to add a measurement delay field to the Configuration struct? The datasheets don't provide the correct values for all combinations of oversampling and IRR filter settings so I think setting the delay is best left to the user.

@oddlama
Copy link

oddlama commented Dec 16, 2023

The datasheets don't provide the correct values for all combinations of oversampling and IRR filter settings so I think setting the delay is best left to the user.

What do you mean exactly? The measurement delay seems to be defined precisely in chapter 9 of the datasheet. And the IIR Filter doesn't add any delay to measurements. I think the 40ms should just be replaced by the correct value for the specific device settings. Unfortunately the owner of this crate hasn't responded or updated the crate for 11 months, so in the meantime I implemented my own driver which respects this. If you want to fork this one and replace the 40ms by the precise calculation, you can view the code here.

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

No branches or pull requests

2 participants