nodeMCU (ESP-12) module with 1.3' oled display

Thread Starter

zazas321

Joined Nov 29, 2015
936
Hey. Could someone give me some guidance on how to use oled display with nodeMCU dev board?





I have used LCD displays before they seemed to be much more easier and more information about them.
I cannot quite understand how to properly set up and use this one to display anything.

First of all, what communication protocol should I use? I assume I2C should be easier because less wires needed
 

dendad

Joined Feb 20, 2016
4,474
Have you checked the I2C address? All those displays are not the same.
Load and run an I2C scanner program first see if the display can be found. It will tell you the address.
But are you sure that is an I2C and not an SPI one?
 

Thread Starter

zazas321

Joined Nov 29, 2015
936
Have you checked the I2C address? All those displays are not the same.
Load and run an I2C scanner program first see if the display can be found. It will tell you the address.
But are you sure that is an I2C and not an SPI one?
I will run scan tommorow

I assummed that the display can be run using both:spi or i2c by user preference. Just different wiring and coding
 

dendad

Joined Feb 20, 2016
4,474
I assummed that the display can be run using both:spi or i2c by user preference. Just different wiring and coding
According to this site..


https://components101.com/oled-display-ssd1306 said:
As discussed above, there are many types of OLED displays available in the market the most popular one is the Monochrome 7-pin SSD1306 0.96” OLED display which we are discussing here. This display can support both IIC and SPI communication. When you receive the module from the factory it will be in 4-wire SPI mode by default and it is the fastest of all available modes. However, you can re-solder the resistors in different positions to make it work in 3-Wire SPI and IIC protocol also.
You may have to mod the display to change it to I2C. I have only used the I2C versions myself.
See also...
https://circuitdigest.com/article/ssd1306-oled-display
 
Last edited:

Raymond Genovese

Joined Mar 5, 2016
1,653
I have used LCD displays before they seemed to be much more easier and more information about them.
I will run scan tommorow

I assummed that the display can be run using both:spi or i2c by user preference. Just different wiring and coding
uploaded a library, programmed the nodemcu, no reaction from my OLED display not even blinked
same results - display does not react at all. Is it possible that it is faulty?
*sigh*

Your display is NOT I2C, it is SPI. See that leetly tinee resistor in your first pic - by the spi writing? That means it has an SPI interface. You should use it as such. There are instructions online to change it to an I2C interface (e.g., https://www.instructables.com/id/OLED-Tutorial-Convert-SPI-to-I2C/). I would advise you to get it working with SPI before doing anything like that and I do not know if those instructions would work with your display.

Why would you think it was an I2C interface?
 

Thread Starter

zazas321

Joined Nov 29, 2015
936
*sigh*

Your display is NOT I2C, it is SPI. See that leetly tinee resistor in your first pic - by the spi writing? That means it has an SPI interface. You should use it as such. There are instructions online to change it to an I2C interface (e.g., https://www.instructables.com/id/OLED-Tutorial-Convert-SPI-to-I2C/). I would advise you to get it working with SPI before doing anything like that and I do not know if those instructions would work with your display.

Why would you think it was an I2C interface?
I did not think that this was i2c in particular, I just assummed that it can work on both therefore i just tried i2c. I will try SPI instead see if I can ger any display. Thanks
 

Thread Starter

zazas321

Joined Nov 29, 2015
936
Following this example :
https://www.instructables.com/id/OLED-Interfaced-to-NodeMCU/





C:
#include <U8glib.h>
U8GLIB_SSD1306_128X64 u8g(5, 4, 16, 2, 0);
void setup() {
  /* nothing to do here */
}
void loop() {
    u8g.firstPage();
  /* Keep looping until finished drawing screen */
  do
  {

   u8g.setFont(u8g_font_osb18);
   u8g.drawStr(30, 20, "Hello"); //(horizontal spacing,vertical spacing,"string")
   u8g.drawStr(20, 50, "Makers!");
  
  } while(u8g.nextPage());

}
 

Thread Starter

zazas321

Joined Nov 29, 2015
936
Or even better, change the display type to I2C, I assume I just have to resolder the resistor from SPI to I2C?
 
Glad you are making some progress.

There are instructions online to change it to an I2C interface (e.g., https://www.instructables.com/id/OLED-Tutorial-Convert-SPI-to-I2C/). I would advise you to get it working with SPI before doing anything like that and I do not know if those instructions would work with your display.
Do yourself a favor and don't try to change it to I2C.

I recommend that you use the u8g2 library https://github.com/olikraus/u8g2/wiki It is, IMO, the best library for you and that screen.
Instead of using the time to try to change it to I2C, use the time and work through how you can correctly write the constructor statement for that screen and once you have that done, you can use the rich command set that u8g2 offers.
 
Top