Problem with OLEDs

I have bought two OLEDs, like shown here:
Now, the problem is I can't get them work properly. On attached pics you can see what I get when I connect them onto Arduino ONE, TWO, or PRO mini. Both of them give me a such garbage, instead of something useful.

Can anyone help me with these?

Thank you in advance!

Judging by the guide on the back and the wiring of S1/S2, you're setup for SPI.

I just updated an u8glib library and now i got them working, but still I get on far right side some unneeded pixels lit, this happens with both displays. How to solve this?

Now I found something interesting: I uploaded a code into my Arduino Pro mini and then completely disconnected an OLED, and then after 10-15 sec reconnected it, and it now works as expected. Now I think I need first to clear an OLED before writing anything to it, but I don't know how, and I didn't found it anywhere (or maybe missed it somehow). Any help? Am I thinking right?

Thank you in advance!

Which u8glib constructor do you use?
The ebay text may be wrong and a SH1106 is there instead of the mentioned SSD1306.


I've tried with constructor for SH1106, but then I got a compiler error 'U8GLIB_SH1106_128X64' does not name a type, so I've then tried with SSD1306 and got result as mentioned above.

Today I found that my u8glib is actually not updated. Hence a compiler error 'U8GLIB_SH1106_128X64' does not name a type. Can someone explain to me how actually to update libraries?

By installing a new version of a library, the existing library is usually overwritten.


OK, but what if this isn't case?

Indeed, a lib can be installed at different locations. You have to search for the locations (e.g. file search for U8glib.h) and just delete the complete u8glib folder which contains U8glib.h)

After this, install U8glib (via the menu entry)