pololu / vl53l0x-arduino

Pololu Arduino library for VL53L0X time-of-flight distance sensor
https://www.pololu.com/product/2490
Other
345 stars 163 forks source link

Possible wrong register value? #17

Closed ssilverman closed 6 years ago

ssilverman commented 6 years ago

https://github.com/pololu/vl53l0x-arduino/blob/22d997afc59625d14c3940d54dfd6d1800efa627/VL53L0X.cpp#L900

The ST source code uses 0x90 here, yours uses 0x92.

kevin-pololu commented 6 years ago

Thanks, that does look like a mistake in our library. Have you tested it both ways and noticed any difference in behavior or performance?

ssilverman commented 6 years ago

I haven't tested either case yet, but I'm not sure how the current SPAD count or aperture type can be read from a register that isn't the same as what the ST reference code uses. Unsure of the impact.

ssilverman commented 6 years ago

I now know why it was 0x92. That's because I didn't notice the 32-bit read, so it turns out your code is correct. I went and reviewed it again.