I am trying to interface mpu6050 to nodemcu as follow:
Vcc - 3v
Gnd - gnd
Sda - D2
Scl - D1
But it's not detecting the sensor
The sensor works with Arduino with connection
Vcc - 5v
Gnd - gnd
Sda - A5
Scl - A4
INT - d2
The code I tried was the Arduino example code with additional Wire.begin(D2,D1) in nodemcu
I had imported this library https://github.com/jrowberg/i2cdevlib/tree/master/Arduino/MPU6050 and run the example code with wiring as Vcc - 3v Gnd - gnd Sda - D2 Scl - D1 and instead of writing Wire.begin(D2,D1) i wrote Wire.begin() and it worked.