My 1.3 inch oled is glitching out

I ordered a 1.3-inch OLED display, and it came today.
I plugged it into my Arduino Uno installed all the libraries and it started to glitch out it looked like this:

Capture.PNG

Thoughts and prayers.

Perhaps if, as well as installing the libraries, you also wrote some code as well it might work better? :wink:

Sorry, I used the default adafruit library

(The code was too long)

code.txt (11.1 KB)

What happens with a basic “hello world” sketch that is much less than 11kB long?

I didn't try that, and I don't know how

Uncompiled, untested

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels

// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
#define OLED_RESET     -1// Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

void setup() 
{
  Serial.begin(9600);

  // SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
  if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3D for 128x64
    Serial.println(F("SSD1306 allocation failed"));
    for(;;); // Don't proceed, loop forever
  }

  // Show initial display buffer contents on the screen --
  // the library initializes this with an Adafruit splash screen.
  display.display();
  delay(2000); // Pause for 2 seconds

  // Clear the buffer
  display.clearDisplay();

  testdrawstyles();    // Draw 'stylized' characters
  // Invert and restore display, pausing in-between
  display.invertDisplay(true);
  delay(1000);
  display.invertDisplay(false);
  delay(1000);
}

void loop()
{
}

void testdrawstyles(void) 
{
  display.clearDisplay();

  display.setTextSize(1);             // Normal 1:1 pixel scale
  display.setTextColor(SSD1306_WHITE);        // Draw white text
  display.setCursor(0,0);             // Start at top-left corner
  display.println(F("Hello, world!"));
  display.display();

  display.setTextColor(SSD1306_BLACK, SSD1306_WHITE); // Draw 'inverse' text
  display.println(3.141592);

  display.setTextSize(2);             // Draw 2X-scale text
  display.setTextColor(SSD1306_WHITE);
  display.print(F("0x")); display.println(0xDEADBEEF, HEX);

  delay(2000);
}

Now it printed out a huge line at the top.
And then it goes back to the original state

And I don't know if it matters but its a 1.3-inch display

Here is a link for it:
https://www.hestore.hu/prod_10035540.html

From your supplier web site it looks like a SD1106 and not SD1306 .