Hi Rui, I received SSD 1306 OLED screen a few days ago, when connecting it to ESP32 with Lora receiver Sketch, it does not work, you see the blank screen and the output by serial monitor is constantly reset. I tried with Sketch example of Adafruit and if it works. When comparing both Sketch the only difference are the following lines of code:
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
Adafruit_SSD1306 display (SCREEN_WIDTH, SCREEN_HEIGHT, & Wire, OLED_RESET);
Copy the lines in Sketch Lora receiver and the SSD 1306 works.
I have read on GitHub that the version of the Adafruit library in November introduces significant changes. https://github.com/adafruit/Adafruit_SSD1306
In principle the old Sketch continue to work with the new library.
I can not understand what the problem is. Possible incompatibility of the SSD 1306 received ?.
Greetings.
Thanks for the heads up Sergio! This weekend I’ll be double-checking that problem to see if the new update those lines are required. I’ll let you know once I test the new version and see the results.
Regards,
Rui
Hello, I’ve just tried it myself today with the latest version of the Adafruit OLED Library and it compiles perfectly for me (the code that I have in the course). Are you using the same display as me?
Hi Rui, I think my SSD1306 is not compatible with previous libraries. In the Sketch with this device I will have to include the lines:
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
Adafruit_SSD1306 display (SCREEN_WIDTH, SCREEN_HEIGHT, & Wire, OLED_RESET);
Features according to seller:
0.96″ I2C IIC Serial 128X64 128*64 White OLED LCD LED Display Module for Arduino
Description:
128*64 LED display module for Arduino, supports many control chip.
Fully compatible with Arduino, 51 Series, MSP430 Series, STM32 / 2, CSR IC, etc.
Ultra-low power consumption: full screen lit 0.08W
Super high brightness and contrast are adjustable
With embedded driver/controller
Interface type is IIC
Pin Definition: GND, VCC ,SCL, SDA
Pins: 4 pins
Voltage: 3V ~ 5V DC
Working Temperature: -30 ℃ ~ 70 ℃
Character Colors: White(as pictures show)
Drive Duty: 1/64 Duty
High resolution: 128 * 64
Panel Dimensions: 26.70* 19.26* 1.85mm/1.03*0.76*0.07 inch(approx)
Active Area: 21.74* 11.2mm /0.86*0.44 inch(approx)
Driver IC: SSD1306
This is my SSD1306
Thanks for letting me know and for sharing your display! I’m not sure why it wouldn’t work without those lines. Can you tell me the exact error that it prints when you don’t add those lines?
Anyway, thanks for sharing your experience. If anyone has the same problem, I’ll point them to this discussion!
Hi Rui, I attached a video of the bug in my ssd1306. Have you tried the difine screen lines in your ssd1306 ?, I have seen that playing with the WIDTH and HEIGHT 128/64 or 128/32 values can change the screen resolution. It can also be played with display.setTextSize (1); or 2, to change size text according to the chosen resolution. I attach photos of different options in my ssd1306.
Saludos.
Photo of errors in monitor series
With WIDTH and HEIGHT 128/64 and display.setTextSize (1)
With WIDTH and HEIGHT 128/64 and display.setTextSize (2)
With WIDTH and HEIGHT 128/32 and display.setTextSize (1)
Actually I’ve never tried those resolutions parameters, because it worked just fine straight way. I also increased the font size before, but never changed the height/width. I think I have the same OLED, but I don’t have that error… Not sure what’s missing and why that happens with your setup.