QR code looks like a jumbled mess


I am trying to print a QR code onto an SSD1306 128x64 display but I’m having some issues, the QR code is a jobbled mess. it doesn’t look like a QR code at all. I am just using the base example code of the ESP8266_QRcode library:


#include <qrcode.h>
#include <SSD1306.h>

SSD1306  display(0x3c, SDA, SCL);
QRcode qrcode (&display);

void setup() {



   // enable debug qrcode
   // qrcode.debug();

   // Initialize QRcode display using library
   // create qrcode
   qrcode.create("Hello world.");


void loop() { }

Here is the QR code:

Thanks all!

Where did your QR code come from? Show us QRcode.h.

Also, you have posted code without using code tags. The code tags make the code look

like this

when posting source code files. It makes it easier to read, and can be copied with a single mouse click. Also, if you don’t do it, some of the character sequences in the code can be misinterpred by the forum code as italics or funny emoticons. The “Code: [Select]” feature allows someone to select the entire sketch so it can be easily copied and pasted into the IDE for testing or review.

If you have already posted without using code tags, open your message and select “modify” from the pull down menu labelled, “More”, at the lower right corner of the message. Highlight your code by selecting it (it turns blue), and then click on the “</>” icon at the upper left hand corner. Click on the “Save” button. Code tags can also be inserted manually in the forum text using the code and /code metatags.

Hi thank you, just edited it could not for the life of me find the code button but I guess I'm just blind lol,

but here is the QRcode.h:

#include "OLEDDisplay.h"

class QRcode
 OLEDDisplay *display;
 void render(int x, int y, int color);

 QRcode(OLEDDisplay *display);

 void init();
 void debug();
 void screenwhite();
 void create(String message);

Here is the full library I'm using is:

and I'm using the Qrcode.h that is in there that mostly calls the qrcode.cpp file.

I also tried to use the ESP QRcode library to the same effect:

Okay, so what happens when you just write a bitmap to the display, like the Adafruit splash screen? Or have you done any other display testing?

I have gone through the example scripts for the oled library and all the images and such print fine no cut offs

I have gone through the example scripts for the oled library and all the images and such print fine no cut offs

But do they initialize the LCD in exactly the same way as the QR example, i.e.
SSD1306  display(0x3c, D6, D7);?

They do not, they do

SSD1306Wire display(0x3c, SDA, SCL)

And i just tried running this and still get the same issue.