Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By JohnPap70
#40681 Hello ESP community!

I was playing with an ESP8266 the ESP-07 version like the one below:
Image

Now I want to make a PCB but I can find the I2C pins!
Here https://learn.sparkfun.com/tutorials/esp8266-thing-hookup-guide/hardware-overview it says that the SDA is the GPIO2 and the SCL is the GPIO14.
Here https://github.com/esp8266/Arduino/blob/master/doc/reference.md it says that the SDA is the GPIO4 and SCL is the GPIO5.
And I manage to use the I2C with SDA on the GPIO5 and SCL on the GPIO4!

What is going on here? Where actually the I2C pins are located?
User avatar
By reaper7
#40683 SDA and SCL are declared inside pins_arduino.h (variants directory) and for generic board this is:
Code: Select allstatic const uint8_t SDA = 4;
static const uint8_t SCL = 5;


You can change it to other by this example:
Code: Select all//configure i2c
#define SDAPIN  5
#define SCLPIN  4
Wire.begin(SDAPIN, SCLPIN);          //sda, scl

or simply
Code: Select allWire.begin(5, 4);          //sda, scl