-->
Page 1 of 4

A4 and A5 of arduino is ??? on ESP8266

PostPosted: Sat Nov 26, 2016 7:21 am
by Lxx33
An oled 128x64 (4 wired) display works on my uno with adafruit library or u8glib, but when I connect it on my esp e12 (CH340G) and connect it to pin D1 and pin D2 it will not work.
Another library (Acrorobotic) does work on those pins.

What pins on the ESP8266 are the same as de A4 and A5 pins of the arduino?

Many many tnx.

Re: A4 and A5 of arduino is ??? on ESP8266

PostPosted: Sat Nov 26, 2016 7:28 am
by Selvabha
Hi,
You are using wrong pins D1 and D2 are used for I2C>You are using SPI i guess,Follow this link.


https://odd-one-out.serek.eu/esp8266-no ... splay-spi/

Re: A4 and A5 of arduino is ??? on ESP8266

PostPosted: Sat Nov 26, 2016 8:12 am
by rudy
The ESP8266 has only one analog pin, A0. There is no equivalent for A4 and A5.
If you are using I2C then you can use D4 and D5. But don't forget to add the required pull up resistors.

I use D0 and D2 for I2C as those two pins need to have a pullup resistor on boot. I then initialize with
lcd.begin(0,2); // SDA=0, SCL=2

Re: A4 and A5 of arduino is ??? on ESP8266

PostPosted: Sat Nov 26, 2016 10:12 am
by Lxx33
Not completely there, but I believe with your help victory will prevail. :)

I connected the display to the ESP8266 E12 with SLC to D2 and SDA to D0.
1 x 4,7K resistor to the 3.3V of the board and the SDA of the display
1 x 4,7K resistor to the 3.3V of the board and the SCL of the display

Un comment the following line:

U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE); // I2C / TWI

I also try to include the
Code: Select alllcd.begin(0,2);
to several places in the Helloworld sketch of the u8glib library.

I get an error that "lcd" was not declared in this scope.