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.
i’m fairly new to the esp32 but was able to get mine working with the SSD_13XX library
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);
}
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
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