Search code examples
i2cnodemcuesp32lidar

How to setup I2C on NodeMCU?


I'm trying to get a LIDAR-Sensor (VL53L1X) working. I connected the Clk-Pin and the SDA-Pin to my Arduino. Then I run the example script (this one). This worked perfectly fine. Then I tried this on my NodeMCU. I connected D1 with CLK and D2 with SDA. I added the Pins in the Wire.begin() line:

Wire.begin(D2, D1);

Now I got this error message:

19:36:40.889 -> load 0x4010f000, len 1384, room 16 
19:36:40.889 -> tail 8
19:36:40.889 -> chksum 0x2d
19:36:40.889 -> csum 0x2d
19:36:40.889 -> v8b899c12
19:36:40.889 -> ~ld
19:36:40.957 -> Failed to detect and initialize sensor!

What I'm doing wrong?


Solution

  • I found out that my NodeMCU was broken