I´m trying to use the ROI funktion of the VL53L1X Sensor on ardiuno.
Im using the SparkFun VL53L1X 4m Laser Distance Sensor Library V1.1.4
I used the setROI(x, y) function to change the ROI.
If I change the first value in the function
distanceSensor.setROI(4, 16);
the sensor stops working at all.
If I change the second value nothing changes.
I build the following code in the loop to check the functionality with the serial plotter:
distanceSensor.setROI(16, 16);
delay(100);
distanceSensor.startRanging(); //Write configuration bytes to initiate measurement
int distance = distanceSensor.getDistance(); //Get the result of the measurement from the sensor
distanceSensor.stopRanging();
//Serial.print("Distance(mm): ");
Serial.print(distance);
Serial.print(" ");
distanceSensor.setROI(4, 4);
delay(100);
distanceSensor.startRanging(); //Write configuration bytes to initiate measurement
distance = distanceSensor.getDistance(); //Get the result of the measurement from the sensor
distanceSensor.stopRanging();
Serial.print(distance);
Serial.println();