• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESP32 OLED SSD1306 problem

Q&A Forum › Category: ESP32 › ESP32 OLED SSD1306 problem
0 Vote Up Vote Down
Lepold Huber asked 7 years ago

Using ESP32 DEVKIT V1, adding an OLED SSD1306,  I2C connection  (SDA, SCL, GPIO 21, 22)  3V3 supply.
Problem: The display shows only a small horizontal gap of about 8 digits screen with some correct information (!), the rest of the screen shows a random spread of black and white. This gap changes the position in different sketches I tried. I googled some hours, but nothing was helping.
I tried different ESP32 libraries for SSD1306, gave pullup resistors (4,7kOhm), reduced speed of I2C to 100kc, and some more, nothing solved my problem.
The display SSD1306 works correct with Arduino Pro-Mini.
Leo

Sorry for the troubles, I have solved the problem: My display was correct a SH1106-typ and not SSD1306.

Thanks for helping, Leo.

Question Tags: OLED SSD1306 problem with ESP32
4 Answers
0 Vote Up Vote Down
Richard Marbury answered 7 years ago

i’m fairly new to the esp32 but was able to get mine working with the SSD_13XX library

0 Vote Up Vote Down
Gerrit Veer answered 7 years ago

Hi Leopold, I use the u8g2. This library supports multiple implementations of 1306 OLED.s.

Here my test-version on ESP32 Adafruit, Succes

*
* Programma: OLED_DEMO.ino
* Versie: 1.0
* Datum: 2017-10-20
*
* Omschrijving: Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
*
* Release:
*
* Bugs:
*
*
*/

#include
#include

#ifdef U8X8_HAVE_HW_SPI
#include
#endif
#ifdef U8X8_HAVE_HW_I2C
#include
#endif

U8G2_SH1106_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE);
// U8X8_SH1106_128X64_NONAME_HW_I2C u8x8(U8X8_PIN_NONE);
/* _R0 = landscape, _R1 .. _R4 = 90, 180, 270 clockwise rotate
_MIRROR = landscape, content mirrored ps. works with setFlipMode.
*/

void setup(void) {
u8g2.begin();
}

void loop(void) {
u8g2.clearBuffer(); // clear the internal memory
u8g2.setFont(u8g2_font_ncenB08_tr); // choose a suitable font
u8g2.drawStr(0,10,”Hello World!”); // write something to the internal memory
u8g2.sendBuffer(); // transfer internal memory to the display
delay(1000);
}

0 Vote Up Vote Down
Gerrit Veer answered 7 years ago

mm. the text between open/close angles is not showed with the includes
lets try again

#include
#include 
#ifdef U8X8_HAVE_HW_SPI
#include
#endif
#ifdef U8X8_HAVE_HW_I2C
#include
#endif
0 Vote Up Vote Down
Rui Santos Staff answered 7 years ago

I’m glad you made it work Leo. If you experience future problems or have more questions. Please create a new question here: https://rntlab.com/ask-question/

Regards,
Rui

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.