sparkfun / SparkFun_VL53L1X_Arduino_Library

A library for the laser based VL53L1X Time Of Flight distance sensor capable of detecting a target 4m away!
MIT License
88 stars 50 forks source link

Should invert signs plus minus! #16

Closed jonesab closed 5 years ago

jonesab commented 5 years ago

https://github.com/sparkfun/SparkFun_VL53L1X_Arduino_Library/blob/4e22e49ac85ce94c1a76c695537574ea745b2f21/src/SparkFun_VL53L1X_Arduino_Library.cpp#L291

Hi @Grahldg , I was testing ROI functions and I've noticed a small bug in the conversions (lines 311 and 313) from getUserRoi(). roi->topLeftY = (2 * row - height) >> 1; roi->bottomRightY = (2 * row + height) >> 1;

Checked the equivalent function within the API (file vl53l1_api.c), so the lines mentionned above should be as following: roi->topLeftY = (2 * row + height) >> 1; roi->bottomRightY = (2 * row - height) >> 1; Cheers,

AndyEngland521 commented 5 years ago

New version of library with different ROI functions, check it out!