Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By eriksl
#17855 I see all mentioning of arduino... If you want to do i2c on esp8266, I don't see what arduino has to do with that.

I think it's quite simple, there appears to be no hardware i2c support on the esp8266, so you're free to use whatever pins you like and run one of the software "bitbanging" implementations on it.
User avatar
By tytower
#17894 It all helps thanks . I note however that in the latest ESP8266-yesterday for Arduino IDE 1.6.4 library Igrr talks about I2C in the readme and uses Wire.begin(0, 2); on ESP-01, else they default to pins 4(SDA) and 5(SCL)..

So in my case it is easier to use pins 6 and 7 so I am playing with "Wire.begin(6, 7);" in setup . It compiles OK and uploads to the board but I have not got it reading the BMP180 yet.
User avatar
By martinayotte
#17897 @tytower, check my post at viewtopic.php?f=28&t=2991#p17753
you can either continue to use the deprecated Wire.pins or applying the fix I did in Wire.cpp :
Code: Select allvoid TwoWire::begin(int sda, int scl){
+  default_sda_pin = sda;
+  default_scl_pin = scl;
  twi_init(sda, scl);   
  flush();
}