Go Down

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

chputney

Programming for an ESP8266, I started to use the Wire library with the Arduino Reference
https://www.arduino.cc/en/Reference/WireBegin

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 ?

Juraj

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

https://arduino-esp8266.readthedocs.io/en/latest/libraries.html#i2c-wire-library
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.

srnet

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.
$50SAT is now Silent (but probably still running)
http://www.50dollarsat.info/
http://www.loratracker.uk/

GolamMostafa

#3
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]
#incldue<Wire.h>
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