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

Possible issue in example #4

Open
MauroMombelli opened this issue Sep 8, 2018 · 3 comments
Open

Possible issue in example #4

MauroMombelli opened this issue Sep 8, 2018 · 3 comments

Comments

@MauroMombelli
Copy link

The proposed example set inter-measurement period to 50ms and setMeasurementTimingBudget to 50ms too.. but the datasheet state you need to set inter-measurement at least 4 ms higher or you will get an error. Have the example been tested and working?

@kevin-pololu
Copy link
Member

Hi,

Could you refer me to where the datasheet says the inter-measurement period must be at least 4 ms higher than the timing budget? I might have missed something.

The API user manual says this on page 10: "If the inter-measurement period is shorter than the timing budget, once the device completes the ranging, the next ranging starts immediately." So it sounds like it should be able to handle the two being equal, although the measurements might not be taken as frequently as intended. I've tested the examples and I haven't noticed any problematic behavior.

Kevin

@MauroMombelli
Copy link
Author

MauroMombelli commented Sep 12, 2018 via email

@kevin-pololu
Copy link
Member

I haven't been able to look into this for a while, but I just checked the UM2356 document and noticed that it is revision 2 on ST's website (what I quoted above was from the rev 1 manual). That seems to correspond to version 2.3.3 of the API, which is dated 5 June 2018 and includes this in its release notes: "Check coherency between timing budget and inter-measurement period."

I believe this library was based on the previous version of the API, V2.3.1, so it makes sense that the timing requirement that was added in V2.3.3 is not present in the library. I will try to look more into whether this is a change I should make to the library so that it matches the API. (I suspect that it might just be an API behavior change to return an error instead of producing less frequent readings than requested if the requested timing is too aggressive.)

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