Go Down

Topic: Why is the Arduino Wire Reference Different (Read 247 times) previous topic - next topic


Programming for an ESP8266, I started to use the Wire library with the Arduino Reference

In trying to find out why my sketch did not work, I looked at other examples and found that Wire.begin accepts two parameters of the SDA and SCL ports, rather than shown in the documentation.

Is there a reason that this documentation is not fixed ?


1) esp8266 is not Arduino
2) the version withou parameters works on esp8266 too. defult pins are io 4 and io 5

You can't write an Arduino sketch if you didn't learn programming. Not the language, but the concepts of programming - algorithms and data types.


Is there a reason that this documentation is not fixed ?
The Arduino documentation does not support the ESP8266 (or ESP32) so it does not need fixing.


Oct 12, 2018, 08:17 am Last Edit: Oct 12, 2018, 08:21 am by GolamMostafa
According to ESP8266 documentation, the ESM8266 (mine NodeMCU1.0-12E Module) will work only as I2C Master and any valid GPIO port line could be used as I2C bus by the following declaration.
Code: [Select]
Wire.begin(12, 13); //SDA, SCL = GPIO12, GPIO13 = D6, D7; default: 4, 5 (D2, D1)

The ESP has no real hardware I2C interface like the Arduino UNO; the Wire.begin(SDA, SCL); commands creates a software I2C interface for the ESP, and it can now utilizes all the avialable functions/methods of Arduino's Wire.h Library.

Go Up