Legacy lcd display 160x160 the library created but compilation say ram out of range

hello everyone , i already ask for help about type of monochrome LCDS 160x160 "i have a lot of them maybe 10 pcs or more , on this topic
i forget that for a moment , i use an olimex project zip file , i extract the lcd library files "Lcd.h" and "lcd.c" because is use the same lcd on project named (TLCD_128CAN)
i modified the whole library to be adaptable with arduino platform , the problem is the expansive Ram by the library , i doesn't have huge understanding about the library codding i got some help from (AI :slight_smile: )about the stricture of writing library he get me skeleton code , the libray CPP file is :

#include "PC1681WE05.h"
#include "font_8x8.h"
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>

extern unsigned char bitmap[160 * 20];

#define lcd_delay 100  //30534 - old

#define CP_PIN 0
#define DISP_PIN 1
#define VHH_PIN 2
#define LP_PIN 3
#define FLM_PIN 4
#define D3_PIN 5
#define D2_PIN 6
#define D1_PIN 7
#define D0_PIN 8
#define EL2_PIN 9
#define EL1_PIN 10
#define EN_PIN 11

#define EN_OFF digitalWrite(EN_PIN, LOW)
#define EN_ON digitalWrite(EN_PIN, HIGH)
#define DISP_OFF digitalWrite(DISP_PIN, LOW)
#define DISP_ON digitalWrite(DISP_PIN, HIGH)
#define VHH_OFF digitalWrite(VHH_PIN, LOW)
#define VHH_ON digitalWrite(VHH_PIN, HIGH)
#define LP_LOW digitalWrite(LP_PIN, LOW)
#define LP_HIGH digitalWrite(LP_PIN, HIGH)
#define FLM_LOW digitalWrite(FLM_PIN, LOW)
#define FLM_HIGH digitalWrite(FLM_PIN, HIGH)
#define D3_LOW digitalWrite(D3_PIN, LOW)
#define D3_HIGH digitalWrite(D3_PIN, HIGH)
#define D2_LOW digitalWrite(D2_PIN, LOW)
#define D2_HIGH digitalWrite(D2_PIN, HIGH)
#define D1_LOW digitalWrite(D1_PIN, LOW)
#define D1_HIGH digitalWrite(D1_PIN, HIGH)
#define D0_LOW digitalWrite(D0_PIN, LOW)
#define D0_HIGH digitalWrite(D0_PIN, HIGH)
#define EL2_LOW digitalWrite(EL2_PIN, LOW)
#define EL2_HIGH digitalWrite(EL2_PIN, HIGH)
#define EL1_LOW digitalWrite(EL1_PIN, LOW)
#define EL1_HIGH digitalWrite(EL1_PIN, HIGH)
#define EN_LOW digitalWrite(EN_PIN, LOW)
#define EN_HIGH digitalWrite(EN_PIN, HIGH)

PC1681WE05::PC1681WE05() {
  pinMode(CP_PIN, OUTPUT);
  pinMode(DISP_PIN, OUTPUT);
  pinMode(VHH_PIN, OUTPUT);
  pinMode(LP_PIN, OUTPUT);
  pinMode(FLM_PIN, OUTPUT);
  pinMode(D3_PIN, OUTPUT);
  pinMode(D2_PIN, OUTPUT);
  pinMode(D1_PIN, OUTPUT);
  pinMode(D0_PIN, OUTPUT);
  pinMode(EL2_PIN, OUTPUT);
  pinMode(EL1_PIN, OUTPUT);
  pinMode(EN_PIN, OUTPUT);
}

void PC1681WE05::initLCD() {
  // Initialize LCD controler
  DISP_OFF;
  VHH_OFF;
  LP_LOW;
  FLM_LOW;
  D3_LOW;
  D2_LOW;
  D1_LOW;
  D0_LOW;
  EL2_LOW;
  EL1_LOW;
}

void PC1681WE05::lcdOn() {
  volatile unsigned int i = 0;

  // delay
   for(i=0; i<65534; i++);
  	EN_ON;

  // delay	30534 - old
  for (i = 0; i < lcd_delay; i++)
    ;
  VHH_ON;

  // delay
  for (i = 0; i < lcd_delay; i++)
    ;
  DISP_ON;

  // delay
  for (i = 0; i < lcd_delay; i++)
    ;
}

void PC1681WE05::lcdOff() {
  volatile unsigned int i = 0;

  // delay
  for (i = 0; i < lcd_delay; i++)
    ;

  DISP_OFF;

  // delay
  for (i = 0; i < lcd_delay; i++)
    ;

  VHH_OFF;

  // delay
  for (i = 0; i < lcd_delay; i++)
    ;

  EN_OFF;
  // delay
  for (i = 0; i < 65534; i++)
    ;
}

void PC1681WE05::setBacklight(unsigned char light) {
  switch (light) {
    case 0:
      EL1_LOW;
      EL2_LOW;
      break;
    case 1:
      EL1_LOW;
      EL2_HIGH;
      break;
    case 2:
      EL2_LOW;
      EL1_HIGH;
      break;
    default:
      EL1_LOW;
      EL2_LOW;
      break;
  }
}

void PC1681WE05::writeBitmap() {

  // variable for loop cycle
  unsigned int i = 0;
  unsigned int j = 0;

  // loop for every row
  // for(i=20; i<(160*20); i+=20) {
  for (i = 0; i < (3200); i += 20) {
    // loop for every col
    for (j = 0; j < 20; j++) {

      // get data
      unsigned char pl = bitmap[i + j];
      unsigned char ph = pl >> 4;
      pl &= 0xF;

      //IO0CLR = 0x001E0000;
      //IO0SET = LookUpSet[ph];

      // clock CP
      //IO0CLR = BIT21; - do it with OC1C

      //IO0CLR = 0x001E0000;
      //IO0SET = LookUpSet[pl];

      // clock CP
      //IO0CLR = BIT21; - do it with OC1C
    }

    if (i) {
      LP_HIGH;
      LP_LOW;
    } else {
      // start new frame
      // for every new frame
      FLM_HIGH;
      LP_HIGH;
      LP_LOW;
      FLM_LOW;
    }
  }

  LP_HIGH;
  LP_LOW;
}

//Blank screen***************************************************

void PC1681WE05::writeBlank() {
  for (int i = 0; i < (3200); i += 20) {
    // loop for every col
    for (int j = 0; j < 20; j++) {
      bitmap[i + j] = 0;
    }
  }
}
// Write char to LCD at specify position
// x, y is coordinate
// invert is 0 or 1 - invert text
void PC1681WE05::writeChar(int x, int y, char ch, bool invert) {
#if 0
		 PGM_P p;
		switch(nmb){
			case 0:	memcpy_P(myrow[pos], &FontLookup[ch-32][0], 8);
	    		break;
			case 1:	memcpy_P(myrow2[pos], &FontLookup[ch-32][0], 8);
	    		break;
			case 2:	memcpy_P(myrow3[pos], &FontLookup[ch-32][0], 8);
	    		break;
			case 3:	memcpy_P(myrow4[pos], &FontLookup[ch-32][0], 8);
	    		break;
			case 4:	memcpy_P(myrow5[pos], &FontLookup[ch-32][0], 8);
	    		break;
			case 5:	memcpy_P(myrow6[pos], &FontLookup[ch-32][0], 8);
	    		break;
			case 6:	memcpy_P(myrow7[pos], &FontLookup[ch-32][0], 8);
    			break;
			case 7:	memcpy_P(myrow8[pos], &FontLookup[ch-32][0], 8);
    			break;
			case 8:	memcpy_P(myrow9[pos], &FontLookup[ch-32][0], 8);
    			break;
			case 9:	memcpy_P(myrow10[pos], &FontLookup[ch-32][0], 8);
    			break;
			case 5:	memcpy_P(myrow6[pos], &FontLookup[ch-32][0], 8);
    			break;
		}
    // END of switch
#endif

#if 1
  if (!invert) {
    memcpy_P(&bitmap[(x + 1) * 20 + y], &FontLookup[ch - 32][0], 1);  //bitmap[(x+1)*20+y] = FontLookup[ch-32][0];
    memcpy_P(&bitmap[(x + 2) * 20 + y], &FontLookup[ch - 32][1], 1);  //bitmap[(x+2)*20+y] = FontLookup[ch-32][1];
    memcpy_P(&bitmap[(x + 3) * 20 + y], &FontLookup[ch - 32][2], 1);  //bitmap[(x+3)*20+y] = FontLookup[ch-32][2];
    memcpy_P(&bitmap[(x + 4) * 20 + y], &FontLookup[ch - 32][3], 1);  //bitmap[(x+4)*20+y] = FontLookup[ch-32][3];
    memcpy_P(&bitmap[(x + 5) * 20 + y], &FontLookup[ch - 32][4], 1);  //bitmap[(x+5)*20+y] = FontLookup[ch-32][4];
    memcpy_P(&bitmap[(x + 6) * 20 + y], &FontLookup[ch - 32][5], 1);  //bitmap[(x+6)*20+y] = FontLookup[ch-32][5];
    memcpy_P(&bitmap[(x + 7) * 20 + y], &FontLookup[ch - 32][6], 1);  //bitmap[(x+7)*20+y] = FontLookup[ch-32][6];
    memcpy_P(&bitmap[(x + 8) * 20 + y], &FontLookup[ch - 32][7], 1);  //bitmap[(x+8)*20+y] = FontLookup[ch-32][7];
  } else {
    memcpy_Pinv(&bitmap[(x + 1) * 20 + y], &FontLookup[ch - 32][0], 1);  //bitmap[(x+1)*20+y] = ~FontLookup[ch-32][0];
    memcpy_Pinv(&bitmap[(x + 2) * 20 + y], &FontLookup[ch - 32][1], 1);  //bitmap[(x+2)*20+y] = ~FontLookup[ch-32][1];
    memcpy_Pinv(&bitmap[(x + 3) * 20 + y], &FontLookup[ch - 32][2], 1);  //bitmap[(x+3)*20+y] = ~FontLookup[ch-32][2];
    memcpy_Pinv(&bitmap[(x + 4) * 20 + y], &FontLookup[ch - 32][3], 1);  //bitmap[(x+4)*20+y] = ~FontLookup[ch-32][3];
    memcpy_Pinv(&bitmap[(x + 5) * 20 + y], &FontLookup[ch - 32][4], 1);  //bitmap[(x+5)*20+y] = ~FontLookup[ch-32][4];
    memcpy_Pinv(&bitmap[(x + 6) * 20 + y], &FontLookup[ch - 32][5], 1);  //bitmap[(x+6)*20+y] = ~FontLookup[ch-32][5];
    memcpy_Pinv(&bitmap[(x + 7) * 20 + y], &FontLookup[ch - 32][6], 1);  //bitmap[(x+7)*20+y] = ~FontLookup[ch-32][6];
    memcpy_Pinv(&bitmap[(x + 8) * 20 + y], &FontLookup[ch - 32][7], 1);  //bitmap[(x+8)*20+y] = ~FontLookup[ch-32][7];
  }
#endif
}

void PC1681WE05::LCDWriteString(int row, int pos, unsigned char* arr, int inv) {

  unsigned int i = pos;

  while((*arr) != '\0') {

   // LCDWriteChar(row, i, (*arr), inv);
    writeChar(row, i, (*arr), inv);

    i++;
    arr++;

  }

}

void PC1681WE05::refresh() {
  // Implement refreshing display
}

void *PC1681WE05::memcpy_Pinv(void * start1, PGM_VOID_P start2, size_t nbytes){

	uint8_t *p1 = (uint8_t*)start1;
	uint8_t *p2 = (uint8_t*)start2;
	unsigned char tmp;
	while(nbytes--) {
		memcpy_P(&tmp,start2++,1);//*p1++ = (uint8_t)(~*p2++);
		tmp=~tmp;
		memcpy(start1++,&tmp,1);
	}
}
and the h file is : 
#ifndef PC1681WE05_h
#define PC1681WE05_h

#include <Arduino.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>

class PC1681WE05 {
public:
    PC1681WE05();
    void initLCD();
    void lcdOn();
    void lcdOff();
    void setBacklight(unsigned char light);
    void writeBitmap();
    void writeBlank();
    void writeChar(int x, int y, char ch, bool invert);
    void LCDWriteString(int row, int pos, unsigned char* arr, int inv);
    void refresh();
private:
    void *memcpy_Pinv(void *dest, PGM_VOID_P src, size_t nbytes);
};

#endif


and the example sketch is : 
#include <Arduino.h>
#include "PC1681WE05.h"

#include "font_8x8.h" 

unsigned char bitmap[160 * 20]; // Define the bitmap array is necessary 

PC1681WE05 lcd;

unsigned long lastDisplayTime = 0;
unsigned long displayInterval = 2000; // Display interval in milliseconds

void setup() {
  // Initialize LCD
  lcd.initLCD();
  lcd.lcdOn();
  lcd.setBacklight(2); // Set backlight to maximum intensity
  
  // Clear the screen
  lcd.writeBlank();
}

void loop() {
  unsigned long currentTime = millis();

  if (currentTime - lastDisplayTime >= displayInterval) {
    lcd.writeBlank();
    lcd.LCDWriteString(0, 0, (unsigned char*)"Hello, World!", 0);
    lastDisplayTime = currentTime;
  }
}

when i compile the code for mega compiled fine , but i doesn't have arduino mega for test the lcd and code , 
can someone here optimizing the library for less ram consumption , 
maybe someone need to know about font_8x8.h is : 

const unsigned char FontLookup[][8] PROGMEM = {

  { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },  // sp
  { 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x04, 0x00 },  // !
  { 0x0A, 0x0A, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00 },  // "
  { 0x0A, 0x0A, 0x1F, 0x0A, 0x1F, 0x0A, 0x0A, 0x00 },  // #
  { 0x04, 0x0F, 0x14, 0x0E, 0x05, 0x1E, 0x04, 0x00 },  // $
  { 0x18, 0x19, 0x02, 0x04, 0x08, 0x13, 0x03, 0x00 },  // %
  { 0x0C, 0x12, 0x14, 0x08, 0x15, 0x12, 0x0D, 0x00 },  // &
  { 0x0C, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00 },  // '
  { 0x02, 0x04, 0x08, 0x08, 0x08, 0x04, 0x02, 0x00 },  // (
  { 0x08, 0x04, 0x02, 0x02, 0x02, 0x04, 0x08, 0x00 },  // )
  { 0x00, 0x04, 0x15, 0x0E, 0x15, 0x04, 0x00, 0x00 },  // *
  { 0x00, 0x04, 0x04, 0x1F, 0x04, 0x04, 0x00, 0x00 },  // +
  { 0x00, 0x00, 0x00, 0x00, 0x0C, 0x04, 0x08, 0x00 },  // ,
  { 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00 },  // -
  { 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x00 },  // .
  { 0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x00, 0x00 },  // /
  { 0x0E, 0x11, 0x13, 0x15, 0x19, 0x11, 0x0E, 0x00 },  // 0
  { 0x04, 0x0C, 0x04, 0x04, 0x04, 0x04, 0x0E, 0x00 },  // 1
  { 0x0E, 0x11, 0x01, 0x02, 0x04, 0x08, 0x1F, 0x00 },  // 2
  { 0x1F, 0x02, 0x04, 0x02, 0x01, 0x11, 0x0E, 0x00 },  // 3
  { 0x02, 0x06, 0x0A, 0x12, 0x1F, 0x02, 0x02, 0x00 },  // 4
  { 0x1F, 0x10, 0x1E, 0x01, 0x01, 0x11, 0x0E, 0x00 },  // 5
  { 0x06, 0x08, 0x10, 0x1E, 0x11, 0x11, 0x0E, 0x00 },  // 6
  { 0x1F, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x00 },  // 7
  { 0x1E, 0x11, 0x11, 0x0E, 0x11, 0x11, 0x0E, 0x00 },  // 8
  { 0x0E, 0x11, 0x11, 0x0F, 0x01, 0x02, 0x0C, 0x00 },  // 9
  { 0x00, 0x0C, 0x0C, 0x00, 0x0C, 0x0C, 0x00, 0x00 },  // :
  { 0x00, 0x0C, 0x0C, 0x00, 0x0C, 0x04, 0x08, 0x00 },  // ;
  { 0x02, 0x04, 0x08, 0x10, 0x08, 0x04, 0x02, 0x00 },  // <
  { 0x00, 0x00, 0x1F, 0x00, 0x1F, 0x00, 0x00, 0x00 },  // =
  { 0x08, 0x04, 0x02, 0x01, 0x02, 0x04, 0x08, 0x00 },  // >
  { 0x0E, 0x11, 0x01, 0x02, 0x04, 0x00, 0x04, 0x00 },  // ?
  { 0x0E, 0x11, 0x01, 0x0D, 0x15, 0x15, 0x0E, 0x00 },  // @
  { 0x0E, 0x11, 0x11, 0x11, 0x1F, 0x11, 0x11, 0x00 },  // A
  { 0x1E, 0x09, 0x09, 0x0E, 0x09, 0x09, 0x1E, 0x00 },  // B
  { 0x0E, 0x11, 0x10, 0x10, 0x10, 0x11, 0x0E, 0x00 },  // C
  { 0x1E, 0x09, 0x09, 0x09, 0x09, 0x09, 0x1E, 0x00 },  // D
  { 0x1F, 0x10, 0x10, 0x1F, 0x10, 0x10, 0x1F, 0x00 },  // E
  { 0x1F, 0x10, 0x10, 0x1E, 0x10, 0x10, 0x10, 0x00 },  // F
  { 0x0E, 0x11, 0x10, 0x13, 0x11, 0x11, 0x0F, 0x00 },  // G
  { 0x11, 0x11, 0x11, 0x1F, 0x11, 0x11, 0x11, 0x00 },  // H
  { 0x0E, 0x04, 0x04, 0x04, 0x04, 0x04, 0x0E, 0x00 },  // I
  { 0x07, 0x02, 0x02, 0x02, 0x02, 0x12, 0x0C, 0x00 },  // J
  { 0x11, 0x12, 0x14, 0x18, 0x14, 0x12, 0x11, 0x00 },  // K
  { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1F, 0x00 },  // L
  { 0x11, 0x1B, 0x15, 0x15, 0x11, 0x11, 0x11, 0x00 },  // M
  { 0x11, 0x19, 0x19, 0x15, 0x13, 0x13, 0x11, 0x00 },  // N
  { 0x0E, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0E, 0x00 },  // O
  { 0x1E, 0x11, 0x11, 0x1E, 0x10, 0x10, 0x10, 0x00 },  // P
  { 0x0E, 0x11, 0x11, 0x11, 0x15, 0x12, 0x1D, 0x00 },  // Q
  { 0x1E, 0x11, 0x11, 0x1E, 0x14, 0x12, 0x11, 0x00 },  // R
  { 0x0E, 0x11, 0x10, 0x0E, 0x01, 0x11, 0x0E, 0x00 },  // S
  { 0x1F, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00 },  // T
  { 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0E, 0x00 },  // U
  { 0x11, 0x11, 0x11, 0x11, 0x11, 0x0A, 0x04, 0x00 },  // V
  { 0x11, 0x11, 0x11, 0x15, 0x15, 0x1B, 0x11, 0x00 },  // W
  { 0x11, 0x11, 0x0A, 0x04, 0x0A, 0x11, 0x11, 0x00 },  // X
  { 0x11, 0x11, 0x11, 0x0A, 0x04, 0x04, 0x04, 0x00 },  // Y
  { 0x1F, 0x01, 0x02, 0x04, 0x08, 0x10, 0x1F, 0x00 },  // Z
  { 0x0E, 0x08, 0x08, 0x08, 0x08, 0x08, 0x0E, 0x00 },  // [
  { 0x00, 0x10, 0x08, 0x04, 0x02, 0x01, 0x00, 0x00 },  // /
  { 0x0E, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0E, 0x00 },  // ]
  { 0x04, 0x0A, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00 },  // ^
  { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00 },  // _
  { 0x10, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00 },  // `
  { 0x00, 0x00, 0x0E, 0x01, 0x0F, 0x11, 0x0F, 0x00 },  // a
  { 0x10, 0x10, 0x16, 0x19, 0x11, 0x11, 0x1E, 0x00 },  // b
  {                                                    // c
    0x00,
    0x00,
    0x0E,
    0x11,
    0x10,
    0x11,
    0x0E,
    0x00 },
  { // d
    0x01,
    0x01,
    0x0D,
    0x13,
    0x11,
    0x11,
    0x0F,
    0x00 },
  { // e
    0x00,
    0x00,
    0x0E,
    0x11,
    0x1F,
    0x10,
    0x0E,
    0x00 },
  { // f
    0x02,
    0x05,
    0x04,
    0x0E,
    0x04,
    0x04,
    0x04,
    0x00 },
  { // g
    0x00,
    0x0D,
    0x13,
    0x13,
    0x0D,
    0x01,
    0x0E,
    0x00 },
  { // h
    0x10,
    0x10,
    0x16,
    0x19,
    0x11,
    0x11,
    0x11,
    0x00 },
  { // i
    0x04,
    0x00,
    0x0C,
    0x04,
    0x04,
    0x04,
    0x0E,
    0x00 },
  { // j
    0x02,
    0x00,
    0x06,
    0x02,
    0x02,
    0x12,
    0x0C,
    0x00 },
  { // k
    0x08,
    0x08,
    0x09,
    0x0A,
    0x0C,
    0x0A,
    0x09,
    0x00 },
  { // l
    0x0C,
    0x04,
    0x04,
    0x04,
    0x04,
    0x04,
    0x0E,
    0x00 },
  { // m
    0x00,
    0x00,
    0x1A,
    0x15,
    0x15,
    0x15,
    0x15,
    0x00 },
  { // n
    0x00,
    0x00,
    0x16,
    0x19,
    0x11,
    0x11,
    0x11,
    0x00 },
  { // o
    0x00,
    0x00,
    0x0E,
    0x11,
    0x11,
    0x11,
    0x0E,
    0x00 },
  { // p
    0x00,
    0x16,
    0x19,
    0x19,
    0x16,
    0x10,
    0x10,
    0x00 },
  { // q
    0x00,
    0x0D,
    0x13,
    0x13,
    0x0D,
    0x01,
    0x01,
    0x00 },
  { // r
    0x00,
    0x00,
    0x16,
    0x19,
    0x10,
    0x10,
    0x10,
    0x00 },
  { // s
    0x00,
    0x00,
    0x0F,
    0x10,
    0x1E,
    0x01,
    0x1F,
    0x00 },
  { // t
    0x08,
    0x08,
    0x1C,
    0x08,
    0x08,
    0x09,
    0x06,
    0x00 },
  { // u
    0x00,
    0x00,
    0x12,
    0x12,
    0x12,
    0x12,
    0x0D,
    0x00 },
  { // v
    0x00,
    0x00,
    0x11,
    0x11,
    0x11,
    0x0A,
    0x04,
    0x00 },
  { // w
    0x00,
    0x00,
    0x11,
    0x11,
    0x15,
    0x15,
    0x0A,
    0x00 },
  { // x
    0x00,
    0x00,
    0x11,
    0x0A,
    0x04,
    0x0A,
    0x11,
    0x00 },
  { // y
    0x00,
    0x00,
    0x11,
    0x11,
    0x13,
    0x0D,
    0x01,
    0x0E },
  { // z
    0x00,
    0x00,
    0x1F,
    0x02,
    0x04,
    0x08,
    0x1F,
    0x00 },
  { // {
    0x02,
    0x04,
    0x04,
    0x08,
    0x04,
    0x04,
    0x02,
    0x00 },
  { // |
    0x04,
    0x04,
    0x04,
    0x00,
    0x04,
    0x04,
    0x04,
    0x00 },
  { // }
    0x08,
    0x04,
    0x04,
    0x02,
    0x04,
    0x04,
    0x08,
    0x00 },
  { // ~
    0x08,
    0x15,
    0x02,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 5F
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 60
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 61
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 62
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 63
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 64
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 65
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 66
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 67
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 68
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 69
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 6A
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 6B
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 6C
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 6D
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 6E
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 6F
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 70
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 71
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 72
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 73
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 74
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 75
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 76
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 77
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 78
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 79
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 7A
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 7B
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 7C
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 7D
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 7E
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 },
  { // 7F
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00 }
};

the compilation for arduino uno is :

Not enough memory; see https://support.arduino.cc/hc/en-us/articles/360013825179 for tips on reducing your footprint.
Sketch uses 2504 bytes (7%) of program storage space. Maximum is 32256 bytes.
Global variables use 3227 bytes (157%) of dynamic memory, leaving -1179 bytes for local variables. Maximum is 2048 bytes.
data section exceeds available space in board

Compilation error: data section exceeds available space in board

the compilation for arduino mega is :

Sketch uses 3124 bytes (1%) of program storage space. Maximum is 253952 bytes.
Global variables use 3227 bytes (39%) of dynamic memory, leaving 4965 bytes for local variables. Maximum is 8192 bytes.

You have 3277 bytes of data. The UNO only has 2K of ram. The mega has 8K of ram. That is what the messages are telling you.

think you for reply,
my decision is if any one can guide me to optimize the library.

its seems like this forum is completely death

No. You copy/paste a program not written for your hardware, then ask someone to re-write the library. It is clear programming is beyond your ability, meaning, someone else would need to write the library for you then write the code for you. You can always ask in the "Paid Jobs" section if you really want it done, because you copy/paste, uninterested in learning.

i rewrite the library to work with arduino, i assumed that you didn't read the original library than writed you're response,and because you talk about "paid job's" that mean do not accept "open source" concept and work as a member of team or however,
if i have a team as hobby on this development domain i did not ask on the forum for any information or help,
think you for you're clear response mean that forum become paid instead of community that help each other, i really appreciate that for never sign in on this platform (arduino forum) again.

Really?

That is good.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.