I2C communication problem with the VL53L1X Time of Flight sensor
Hello,
I'm trying to use the VL53L1X on my nRF52DK, but I experience some problems.
Previously, I've successfully used the VL53L1X with an Arduino UNO using the pololu Arduino library (link below). For my project I need to use this sensor on the nRF52, so I've rewritten the vl53l1_platform.cpp and main .ino code to C (the other files are from ST's VL53L1 API, which are already in C).
When the sensor is not connected, the nRF52 is writing the correct data to the SCL and SDA lines, but if I connect the sensor, these lines give incorrect data. Instead of sending to address 0x29, it sends to address 0x7F or 0x00. And instead of sending the data 0x01 and 0x0F, it sends 0xFF and 0xFF (or 0x00 and 0x00).
I have correctly connected and initialized the INT and XSHUT lines.
I'm not sure what the problem can be, because it worked with the Arduino UNO, but not with the nRF52 (even though the I2C is working correctly without the sensor).
My setup:
- nrf52DK
- VL53L1X Time of Flight sensor
- Logic analyser to read the I2C communication
- Pololu VL53L1X library for Arduino: GitHub - pololu/vl53l1x-st-api-arduino: ST VL53L1X API implementation for Arduino
