What library should I use for my OLED 1.5 128x128 SSD1327 Waveshare

Hello all, I have bought OLED display and as you can tell from the title is waveshare 1.5inch 128x128 display.
I have watched a tutorial(very descriptive) about the I2C and SPI OLED displays and after it I went for a try with my display and the arduino uno I have, after putting the reccomendet library from the video and indeed seeing it draws a LOT of memory from my uno I started working on understanding the functions in the library and their params.
But even when I was making one line with 2x2 pixels and 2 3x3 pixels dots I was using around 4000 bytes from my 32000 bytes I can reach. For me this is a lot, since I am planning on making eyes for my robot and they will be bigger than the 2 dots I made.
I thought the atmega chip was not powerfull enough, but then came across arduino nano or something of that sort drawing way bigger dots/eyes than my uno.
That got me thinking that I am not managing my recources correctly, but here comes my problem. In the tutorial I saw the nano, they were using display with SSD1306 and my display uses SSD1327 and is 128x128 and I think the library adafruit can work with 128x64 at max. What library should I use in order to not use so much memory out of my arduino uno?
Sorry if my description of the problem was noobish.
Thank you in advance for the help! :slight_smile:
P.S. I am using this https://www.waveshare.com/wiki/File:1.5inch_OLED_Moudle.7z and it has example and few libraries in it.
I heard of u8g2 library, but was told it is heavy too(have not tried it yet, should I?)
I just want to make some eyes, eyes expressions and display text from time to time, think it is not a lot for my uno, when something similar was made with nano already.

U8g2lib should work fine with your Uno.
It treats your Grayscale display like a monochrome display. But you can draw pixel accurate graphics.

It is easy to display Grayscale images e.g. eyes.
Not very easy to draw transparent text but solid text is ok.

I think that the only real choice of library is U8g2lib. You will be limited by how many 128x128 grayscale images you can fit in Uno's Flash. 128x128x4 uses 8kB. You are only likely to get store two 8kB images if you want a text font as well.
Of course 128x128x1 i.e. monochrome is only 2kB. Or smaller grayscale images use less Flash.

Don't worry about the minimum memory use. Just design for what you want. The Uno has 31.5kB available for your application.

Read this current thread
bitbank has created a small SSD1327 library.


Thank you for the help and advices. :slight_smile:
So I have installed u8g2, but when I tried to run simple example scetch of hello world it says:
"Global variables use 2550 bytes of dynamic memory. The maximum is 2048."
And it is something simple, not even remotely complicated(this is the scetch):

#include <Arduino.h>
#include <U8g2lib.h>

#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h>
U8G2_SSD1327_EA_W128128_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 7, /* reset=*/ 8);
void setup(void) {

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
  } while (u8g2.nextPage());  

What should I use in order to not get that memory problem?
Also the program memory is 8k bytes out of 32k, but you said not to worry about it so muh so I wont look at it that much, but the sram is a problem. :frowning:

Change the full-buffer F constructor to a small buffer-style constructor e.g. 1 version.

U8G2_SSD1327_EA_W128128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 7, /* reset=*/ 8);

Changing the F into 1 may not be sufficient (sendBuffer is not supported with the 1 constructors). Better start with the page mode examples.


I have used u8x8.drawTile function and that consumed significantly less SRAM and Flash memory. Thank you all for the advices. :slight_smile: