Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By Sunspot
#21239 Yes - pullups OK (the Adafruit was fine with a Uno driving the i2c wires)

The above code is basic and indeed does not include the Adafruit driver - it just uses wire alone

As I say above the scanner works and a the esp01 can also drive a PCF8574 fine - all from the same test board.

I am wondering if the I2C is too fast - there is little else to try since the Uno drives the chip fine
- and yet all attempts to drop the speed fail
:( :( :( :( :( :(
:?: :?: :?: :?: :?: :?:
User avatar
By costo
#21438 I2C works fine for me. I use Arduino 1.6.5 IDE which, for me , is better than 1.6.4.
Have I2C working with DS1307 clock. Use it in I2C Master/Slave configuration, where the ESP is the Master and an Arduino_board is Slave , so I can read 8 Analog 10 bit ADC channels (ESP has only one ADC which seems not very accurate)
Also works with OLED's (SDD1306 and SH1106 controller) and this I2C interface-board with PCF8574 used as interface for 16x2 and 20x4 LCD displays.

LiquidCrystal_I2C Example : viewtopic.php?f=29&t=2289

lib found here: https://github.com/fdebrabander/Arduino ... 2C-library

add this:
#ifdef ARDUINO_ESP8266_ESP01
Wire.pins(0, 2);
#endif
for ESP01 use pins 0,2 (GPIO0=SDA , GPIO2=SCL)
for ESP_boards with more IO_pins use whichever 2 GPIO_pins you like.

If I2C-LCD module is 5-Volt, remove the 2 SMD I2C pull_up resistors on the interface board and use external pull_up resistors to the ESP 3V3. (4k7)
User avatar
By kolban
#24859 I too am having problems getting I2C working with the Arduino IDE. My Sketch is provided as an attachment. What the sketch does is identify which devices are attached to which address and in all my tests, the result is no I2C devices found. I am using an ESP-12 with GPIO4 as SDA and GPIO5 as SCL. If anyone has any suggestions for how to proceed with diagnostics, that would be fantastic.

Neil
You do not have the required permissions to view the files attached to this post.
User avatar
By burkmurray
#24861 @kolban - some ESP12's have GPIO4 and GPIO5 reversed on the silkscreen. If you're not getting any response from a scan, you may want to try reversing the pins.