Skip to content

Conversation

josephduchesne
Copy link
Contributor

I've been exploring sweeping the ROI around to get a "2d" lidar out of each VL53L1x and found that with continuous ranging (StartRanging/StopRanging), the sensor wasn't "taking" the updated ROI consistantly.

I tried waiting for a reading to complete, then stopping the ranging operation in the gap between the timing budget and inter-measurement period, but this was really fragile and would frequently stop working and I'd get results from the wrong SPAD ROI, even though reading the SPAD ROI showed the correct number (which I might put in as another PR with some ROI setting improvements I'm working on).

I think it's just a problem in the internal sensor state machine, where calling stop doesn't take effect immediately, and the ROI settings applied when ranging is active don't work (the datasheet errata talks about how setting ROI when ranging is invalid, but doesn't elaborate).

With this method, I can 100% reliably set the ROI, trigger ranging, then get a single result in a loop, wheras before I had to start, get the results, and stop all spaced out by carefully tuned magic delay numbers.

I tried to match the existing code style in each file, but I'm open to suggestions.

@tig
Copy link

tig commented Jul 22, 2021

I can vouch for this PR.

Copy link
Contributor

@PPVJM PPVJM left a comment

Choose a reason for hiding this comment

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

Thanks for the added functionality @josephduchesne! I have added it to the library.

@PPVJM PPVJM merged commit 2ae39a1 into sparkfun:master Jan 31, 2022
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.

3 participants