# 192X64 SLG19264B LCD display

**URL:** <https://forum.arduino.cc/t/192x64-slg19264b-lcd-display/620322>\
**Category:** Displays\
**Created:** [November 12, 2019, 9:00pm UTC](https://forum.arduino.cc/t/192x64-slg19264b-lcd-display/620322 "2019-11-12T21:00:53Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![david\_prentice](https://avatars.discourse-cdn.com/v4/letter/d/96bed5/32.png) [@david\_prentice](https://forum.arduino.cc/u/david_prentice)\
**Post date:** [November 15, 2019, 8:27am UTC](https://forum.arduino.cc/t/192x64-slg19264b-lcd-display/620322/21 "2019-11-15T08:27:23Z")

</div>

I do not have your display.  
I built the paged example from #18 for a Uno with \_1 constructor:

```cpp
Using library U8g2 at version 2.26.14 in folder: C:\Users\David Prentice\Documents\Arduino\libraries\U8g2 
Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino-1.8.9\hardware\arduino\avr\libraries\SPI 
Using library Wire at version 1.0 in folder: C:\Program Files (x86)\Arduino-1.8.9\hardware\arduino\avr\libraries\Wire 
"C:\\Program Files (x86)\\Arduino-1.8.9\\hardware\\tools\\avr/bin/avr-size" -A "C:\\Users\\DAVIDP~1\\AppData\\Local\\Temp\\arduino_build_680476/jxid_ks0108.ino.elf"
Sketch uses 9510 bytes (29%) of program storage space. Maximum is 32256 bytes.
Global variables use 588 bytes (28%) of dynamic memory, leaving 1460 bytes for local variables. Maximum is 2048 bytes.

```

Paged example with \_F constructor:

```cpp
U8G2_KS0108_ERM19264_F u8g2(U8G2_R0, 5, 6, 7, 8, 9, 10, 11, 12, 4, 2, 13, A1, A2, A0);

```

```cpp
Sketch uses 9514 bytes (29%) of program storage space. Maximum is 32256 bytes.
Global variables use 1932 bytes (94%) of dynamic memory, leaving 116 bytes for local variables. Maximum is 2048 bytes.

```

Your full buffer example from #15 with \_1

```cpp
Sketch uses 9078 bytes (28%) of program storage space. Maximum is 32256 bytes.
Global variables use 588 bytes (28%) of dynamic memory, leaving 1460 bytes for local variables. Maximum is 2048 bytes.

```

Or your code with \_2

```cpp
Sketch uses 9082 bytes (28%) of program storage space. Maximum is 32256 bytes.
Global variables use 780 bytes (38%) of dynamic memory, leaving 1268 bytes for local variables. Maximum is 2048 bytes.

```

Or your code with \_F

```cpp
Sketch uses 9082 bytes (28%) of program storage space. Maximum is 32256 bytes.
Global variables use 1932 bytes (94%) of dynamic memory, leaving 116 bytes for local variables. Maximum is 2048 bytes.

```

You can see that the Full Buffer only leaves 116 bytes of SRAM. The program will _probably_ crash.

Yes, life is easier with a Full buffer. Fine for a 128x64 on a Uno. Your 192x64 needs too much SRAM on a Uno.  
With a Paged constructor means you have to use the firstPage() .. nextPage() construction.  
But at least it will run on a Uno.

David.

---

<div class="post-metadata">

**Author:** ![jxid](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jxid](https://forum.arduino.cc/u/jxid)\
**Post date:** [November 15, 2019, 8:13pm UTC](https://forum.arduino.cc/t/192x64-slg19264b-lcd-display/620322/22 "2019-11-15T20:13:57Z")

</div>

> david\_prentice:  
> I have wasted lots of time.
> 
> Why don't you just try the Paged Buffer examples with the constructor that I suggested. e.g.
> 
> ```arduino
> #include <Arduino.h>
> 
> ```

#include \<U8g2lib.h\>

#ifdef U8X8\_HAVE\_HW\_SPI  
#include \<SPI.h\>  
#endif  
#ifdef U8X8\_HAVE\_HW\_I2C  
#include \<Wire.h\>  
#endif

/\*  
&nbsp;U8g2lib Example Overview:  
&nbsp; &nbsp;Frame Buffer Examples: clearBuffer/sendBuffer. Fast, but may not work with all Arduino boards because of RAM consumption  
&nbsp; &nbsp;Page Buffer Examples: firstPage/nextPage. Less RAM usage, should work with all Arduino boards.  
&nbsp; &nbsp;U8x8 Text Only Example: No RAM usage, direct communication with display controller. No graphics, 8x8 Text only.  
&nbsp; &nbsp;  
&nbsp;This is a page buffer example. &nbsp; &nbsp;  
\*/

U8G2\_KS0108\_ERM19264\_1 u8g2(U8G2\_R0, 5, 6, 7, 8, 9, 10, 11, 12, 4, 2, 13, A1, A2, A0);

void setup(void) {  
&nbsp;pinMode(3, OUTPUT);  
&nbsp;digitalWrite(3, 0);  
&nbsp;u8g2.begin(); &nbsp;  
}

void loop(void) {  
&nbsp;u8g2.firstPage();  
&nbsp;do {  
&nbsp; &nbsp;u8g2.setFont(u8g2\_font\_ncenB10\_tr);  
&nbsp; &nbsp;u8g2.drawStr(0,24,"Hello World!");  
&nbsp;} while ( u8g2.nextPage() );  
&nbsp;//delay(1000);  
}

> ```arduino
> 
> ```

Well David thank you very much for your time.  
You helped me a lot.  
The above example it uses less SRAM in my UNO R3.

```arduino
Sketch uses 9430 bytes (29%) of program storage space. Maximum is 32256 bytes.
Global variables use 558 bytes (27%) of dynamic memory, leaving 1490 bytes for local variables. Maximum is 2048 bytes.

```

---

<div class="post-metadata">

**Author:** ![jxid](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jxid](https://forum.arduino.cc/u/jxid)\
**Post date:** [November 16, 2019, 10:52am UTC](https://forum.arduino.cc/t/192x64-slg19264b-lcd-display/620322/23 "2019-11-16T10:52:33Z")

</div>

Here is a demo project that i made with the help of David.  
It prints greek words in the display.

```cpp
#include <Arduino.h>
#include <U8g2lib.h>
#include <SPI.h>
#include <Wire.h>
#define U8X8_HAVE_HW_SPI

U8G2_KS0108_ERM19264_1 u8g2(U8G2_R0, 5, 6, 7, 8, 9, 10, 11, 12, 4, 2, 13, A1, A2, A0);

void setup(void) {
  pinMode(3, OUTPUT);
  digitalWrite(3, 0);
  u8g2.begin();  
}

void loop(void) {
  u8g2.firstPage();
  do 
    {
    u8g2.setFont(u8g2_font_cu12_t_greek);
    u8g2.drawUTF8(0,12,"Καλησπέρα - ΚΑΛΗΣΠΕΡΑ");
    u8g2.setFont(u8g2_font_unifont_t_greek);
    u8g2.drawUTF8(0,30,"Καλησπέρα - ΚΑΛΗΣΠΕΡΑ");
    u8g2.setFont(u8g2_font_10x20_t_greek);
    u8g2.drawUTF8(0,50,"Καλησπέρα-ΚΑΛΗΣΠΕΡΑ");            
    } 
  while ( u8g2.nextPage() );
}

```

```cpp
Sketch uses 19252 bytes (59%) of program storage space. Maximum is 32256 bytes.
Global variables use 624 bytes (30%) of dynamic memory, leaving 1424 bytes for local variables. Maximum is 2048 bytes.

```

Thaks for the help.

---

<div class="post-metadata">

**Author:** ![jxid](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jxid](https://forum.arduino.cc/u/jxid)\
**Post date:** [November 16, 2019, 8:15pm UTC](https://forum.arduino.cc/t/192x64-slg19264b-lcd-display/620322/24 "2019-11-16T20:15:15Z")

</div>

And here is a demo with bitmaps print.

```cpp
#include <Arduino.h>
#include <U8g2lib.h>
#define U8X8_HAVE_HW_SPI
#include <SPI.h>

#include <Wire.h>

U8G2_KS0108_ERM19264_1 u8g2(U8G2_R0, 5, 6, 7, 8, 9, 10, 11, 12, 4, 2, 13, A1, A2, A0);

#define gps2_width 50
#define gps2_height 64
static const unsigned char gps2_bits[] PROGMEM = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
   0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x07, 0x00, 0x00, 0x00,
   0x00, 0x30, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x80, 0x01, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x00, 0x03, 0x00, 0x00, 0x00,
   0xc0, 0xa2, 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x0c, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
   0x10, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x60, 0x30, 0x00, 0x00, 0x00, 0x80,
   0xf7, 0xc0, 0x20, 0x00, 0x00, 0x00, 0x00, 0x80, 0x83, 0x61, 0x00, 0x08,
   0x00, 0x00, 0x00, 0x06, 0x41, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0c, 0xc3,
   0x00, 0x78, 0x00, 0x00, 0x00, 0x08, 0x42, 0x00, 0xf8, 0x01, 0x00, 0x00,
   0x18, 0x02, 0x00, 0xd8, 0x07, 0x00, 0x00, 0x10, 0x02, 0x00, 0x98, 0x1f,
   0x00, 0x0c, 0x30, 0x00, 0x00, 0x18, 0x7e, 0x00, 0x1c, 0x00, 0x00, 0x00,
   0x18, 0xfe, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x18, 0xfe, 0x07, 0x1e, 0x00,
   0x00, 0x00, 0x18, 0xfe, 0x0f, 0x0e, 0x00, 0x00, 0x00, 0x30, 0xfe, 0x3f,
   0x06, 0x00, 0x00, 0x00, 0x30, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x00, 0x30,
   0xfc, 0xff, 0x03, 0x00, 0x00, 0x00, 0x60, 0xfc, 0xff, 0x0f, 0x00, 0x00,
   0x00, 0x60, 0xfc, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xe0, 0xf8, 0xff, 0xff,
   0x00, 0x00, 0x00, 0xc0, 0xf8, 0xff, 0xff, 0x03, 0x00, 0x00, 0x80, 0xf9,
   0xff, 0xff, 0x07, 0x00, 0x00, 0x80, 0xf3, 0xff, 0xff, 0x1f, 0x00, 0x00,
   0x00, 0xf3, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xee, 0xff, 0xff, 0xff,
   0x01, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xf8, 0xff,
   0xff, 0xff, 0x1f, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00,
   0xe0, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x1f,
   0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0xfe, 0xff,
   0xff, 0x01, 0x00, 0x00, 0x10, 0xf8, 0xff, 0xff, 0x00, 0x00, 0x00, 0x38,
   0xc0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xe8, 0x00, 0x50, 0x00, 0x00, 0x00,
   0x00, 0xc8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x0f, 0x00, 0x00,
   0x00, 0x00, 0x00, 0xc4, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0xff,
   0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
   0xe2, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf2, 0xff, 0x01, 0x00, 0x00,
   0x00, 0x00, 0xf3, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf9, 0xff, 0x03,
   0x00, 0x00, 0x00, 0x00, 0xf9, 0xff, 0x03, 0x00, 0x00, 0x00, 0x80, 0xfd,
   0xff, 0x07, 0x00, 0x00, 0x00, 0x80, 0xfe, 0xff, 0x07, 0x00, 0x00, 0x00,
   0xc0, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00 };

#define gps_width 32
#define gps_height 32
static const unsigned char gps_bits[] PROGMEM = {
   0x00, 0x00, 0x01, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x1c, 0x38, 0x00,
   0x00, 0x03, 0xe0, 0x00, 0x80, 0x01, 0x80, 0x01, 0x80, 0x00, 0x00, 0x01,
   0xc0, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x06, 0x20, 0x8e, 0x73, 0x04,
   0x20, 0x11, 0x80, 0x04, 0x20, 0x81, 0x14, 0x04, 0x20, 0x98, 0xc3, 0x04,
   0x30, 0x01, 0x00, 0x0c, 0x20, 0x31, 0x90, 0x04, 0x20, 0x8c, 0x60, 0x04,
   0x20, 0x00, 0x00, 0x04, 0x40, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x03,
   0x80, 0x00, 0x00, 0x01, 0x80, 0x01, 0x80, 0x01, 0x00, 0x03, 0xc0, 0x00,
   0x00, 0x0f, 0x78, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0xfc, 0x3f, 0x00,
   0x00, 0xf8, 0x1f, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0xf0, 0x0f, 0x00,
   0x00, 0xe0, 0x07, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00,
   0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };

#define weather_width 32
#define weather_height 32
static const unsigned char weather_bits[] PROGMEM = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x20, 0x84, 0x00, 0x00,
   0x40, 0x84, 0x00, 0x00, 0x80, 0x44, 0x00, 0x00, 0x80, 0x3f, 0x08, 0x00,
   0x8c, 0x7f, 0x06, 0x00, 0xf0, 0xe1, 0x03, 0x00, 0xe0, 0x40, 0x00, 0x00,
   0x60, 0x00, 0xf8, 0x01, 0x76, 0x00, 0xfc, 0x07, 0x64, 0x00, 0x0e, 0x0e,
   0x60, 0xe0, 0x07, 0x0c, 0x60, 0xf0, 0x03, 0x0c, 0x18, 0x18, 0x00, 0x18,
   0x0c, 0x1c, 0x00, 0x38, 0x00, 0x0f, 0x00, 0x70, 0x80, 0x0f, 0x00, 0x60,
   0xc0, 0x01, 0x00, 0xc0, 0xc0, 0x00, 0x1c, 0xc0, 0xc0, 0x00, 0x1c, 0x60,
   0xc0, 0x01, 0x0c, 0x60, 0x80, 0x37, 0x0e, 0x7b, 0x00, 0x3f, 0x0e, 0x1f,
   0x00, 0x20, 0x1e, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x0c, 0x00,
   0x00, 0x00, 0x04, 0x0c, 0x00, 0x0c, 0x04, 0x0e, 0x00, 0x0e, 0x00, 0x0e,
   0x00, 0x0e, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00 };

   
void setup(void) {
  pinMode(3, OUTPUT);
  digitalWrite(3, 0);
  u8g2.begin();
}

void loop(void) {
  u8g2.firstPage();
  do {
  u8g2.clearBuffer();
  u8g2.drawXBMP( 2, 0, gps2_width, gps2_height, gps2_bits);
  u8g2.drawXBMP( 160, 0, gps_width, gps_height, gps_bits);
  u8g2.drawXBMP( 160, 32, weather_width, weather_height, weather_bits);          
  }
  while(u8g2.nextPage());
 // delay(1000);
}

```

Just for reference for anyone who may have the same questions as i did.  
Yannis

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 6, 2021, 4:03am UTC](https://forum.arduino.cc/t/192x64-slg19264b-lcd-display/620322/25 "2021-05-06T04:03:33Z")

</div>

Closed on May 6, 2021, 4:03am UTC



[Previous page](https://forum.arduino.cc/t/192x64-slg19264b-lcd-display/620322.md?page=1)
