Open samehhady opened 9 years ago
Well there are many things can go wrong. Let me try to explain. First, the screen you linked said "for Arduino". Arduino usually uses 5V I/O, but ESP8266 uses 3.3V. You can check if there is a series resistor on SCL and SDA pin. If there is, it should be shorted. Secondly, please check if the screen module has builtin pull-up resistor on I2C bus. Above are hardware issues. If you have a oscilloscope or a logic analyzer these will be easy to diagnose. Then, for software issues, there are some 0.96in Oled screens that are using SH1106 controller instead of SSD1306. I do not know how to differentiate them but the instruction sets are different. One more possibility is the I2C address, I see there is a jumper on the module labeled address. It should be 1-3D and 0-3C. Finally you may check the initialization code for GPIO 2 and 14, you may post your code and I can have a try.
cheers
Baoshi
Baoshi,
Thank you for your detailed reply.
Well my screen can work with both 3.3v & 5v, I've tested it on Arduino ( 3.3v ) and it worked perfectly with the U8glib library, and from this library I knew it is the ssd1306 version.
One other test that I did is to try another code for lua which works for ssd1306 & it worked directly beside the idea that is it very simple demo but at least I saw something on my screen. I was using the same 2 pins on the lua script. http://www.esp8266.com/viewtopic.php?f=24&t=1318&hilit=ssd1306#p7747
So I guess my screen is fine and no need for resistor or shortening anything?
I've tried your code as it is and just modified the pin part and change it to:
i2c.c:
//! @brief GPIO MUX for SDA pin
//! @brief GPIO FUNC for SDA pin
//! @brief GPIO pin location for SDA pin
//! @brief GPIO bit location for SDA pin
//! @brief GPIO MUX for SCL pin
//! @brief GPIO FUNC for SCL pin
//! @brief GPIO pin location for SCL pin
//! @brief GPIO bit location for SCL pin
ssd1306_i2c.c:
//! @brief I2C address for panel 0
//! @brief If panel 0 has external RESET pin, define this as 1
//! @brief GPIO MUX for panel 0 RESET pin
//! @brief GPIO FUNC for panel 0 RESET pin
//! @brief GPIO bit location for panel 0 RESET pin
//! @brief Panel 1 type, define to SSD1306_NONE if not used.
//! @brief I2C address for panel 1
//! @brief If panel 1 has external RESET pin, define this as 1
//! @brief GPIO MUX for panel 1 RESET pin
//! @brief GPIO FUNC for panel 1 RESET pin
//! @brief GPIO bit location for panel 1 RESET pin
and in the init method in the shell file i removed the first screen and only checking ssd1306_init(1)
Hi, I just tried your code and pin configuration and if works nicely, except mine screen address is 0x3D. You may try both addresses see if it works. Cheers, Baoshi
Hello, first of all thank you for your work.
I am having issues tho, I have it all compiled and flashed to my ESP but I am not able to show anything on my screen.
I am only using 1 screen which is Chinese SSD1306 version.
http://www.aliexpress.com/item/Free-shipping-1Pcs-128X64-OLED-LCD-LED-Display-Module-For-Arduino-0-96-I2C-IIC-SPI/2036109567.html
I have updated the i2c.c & ssd1306_i2c.c as you mentioned and changed the pins ( I am using pin 2 & 14 )
When I press init i get failed message & by debugging it seems failing in the i2c_write(ctx->address) part as it seems always coming with false.
Do i have to change this address based on my oled? 0x3c, 0x3d, etc
Can you please help me in figuring out this issue.
Thanks. Sameh