pimoroni / pimoroni/vl53l1x-python
why some measurements are longer than others?
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 106
- Forks
- 58
- Avg merge
- 1h 17m
- Merged PRs (30d)
- 1
Description
Hi,
I noticed that one of the first measurements takes significantly longer than the others.
Example:
import VL53L1X
import time
tof = VL53L1X.VL53L1X(i2c_bus=1, i2c_address=0x29)
tof.open()
tof.set_timing(66000, 70)
tof.start_ranging(1)
for i in range(0, 5):
start_time = time.time()
distance = round(tof.get_distance()/10)
print(f"{i} measurement time: {time.time() - start_time)}")
tof.stop_ranging()

I tried to manipulate timing budget values, but no result. It's always the same.
Do you have any idea why this is happening?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported Python example with VL53L1X.VL53L1X.get_distance(), using the shown timing budget and five-measurement loop. Trace the first-call path and compare it with later calls; done means identifying why the first measurement takes longer and recording or addressing the cause.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100