Member #1499484

Member Since: February 5, 2019

Country: United States

  • Hi there I was trying to narrow the FoV bei changing the RoI with your library. I don't want to go as far as calling it a bug since I have no clue what your programmers intended to achieve with the specific line of code, however I seem to have found a solution. In the library you have the following fnct:

    VL53L1X_ERROR VL53L1X::VL53L1X_SetROI(uint16_t X, uint16_t Y) { uint8_t OpticalCenter; VL53L1X_ERROR status = 0;

    status =VL53L1_RdByte(Device, VL53L1_ROI_CONFIG__MODE_ROI_CENTRE_SPAD, &OpticalCenter);
    if (X > 16)
        X = 16;
    if (Y > 16)
        Y = 16;
    if (X > 10 || Y > 10){      
        OpticalCenter = 199;
    }
    status = VL53L1_WrByte(Device, ROI_CONFIG__USER_ROI_CENTRE_SPAD, OpticalCenter);
    status = VL53L1_WrByte(Device, ROI_CONFIG__USER_ROI_REQUESTED_GLOBAL_XY_SIZE,
               (Y - 1) << 4 | (X - 1));
    return status;
    

    }

    -> Changing the RoI to anything lower than 11 will result in no distance readings (-1). I changed the code from: ....if (X > 10 || Y > 10){ ....
    to this: ....if (X > 0 || Y > 0){ ....
    This leads to an optical center value being assigned and distance values will be returned.

    This might help someone struggling with the same problem.

No public wish lists :(