user46289: what are the SDA & SCL pins in NodeMCU? (Pins 20 & 21 in Arduino MEGA2560) I already implemented a simple project to read 2 accelerometers values from Arduino and send them through wifi to firebase database. I used Arduino Mega before for the same project and the sensors gave me readings between approximately -300 to 300. Now when I moved to NodeMCU the sensors became very sensitive and are getting values up to 65500+. And with a very small angle change the axis reading drop down to 20 or less.
I used pins D1 and D2 for SCL and SDA. Are the pins correct? And What about the reading values how to fix that?

user37857: The ESP8266 doesn't have a hardware Two Wire Interface. I²C is done in software, so you can use any 2 pins, as long as you specify them in your code using Wire.begin(SDA, SCL).
My guess would be that there's another problem. 65500+ sounds like an integer overflow, for example. ((uint16_t) -1 == 65535)

46289: <p>what are the SDA &amp; SCL pins in NodeMCU? (Pins 20 &amp; 21 in Arduino MEGA2560) I already implemented a simple project to read 2 accelerometers values from Arduino and send them through wifi to firebase database. I used Arduino Mega before for the same project and the sensors gave me readings between approximately -300 to 300. Now when I moved to NodeMCU the sensors became very sensitive and are getting values up to 65500+. And with a very small angle change the axis reading drop down to 20 or less.</p>

<p>I used pins D1 and D2 for SCL and SDA. Are the pins correct? And What about the reading values how to fix that?</p>
 37857: <p>The ESP8266 doesn't have a hardware Two Wire Interface. I²C is done in software, so you can use any 2 pins, as long as you specify them in your code using <code>Wire.begin(SDA, SCL)</code>.</p>

<p>My guess would be that there's another problem. 65500+ sounds like an integer overflow, for example. (<code>(uint16_t) -1 == 65535</code>)</p>
