Buffer and PROGMEM

TGGeko:
Hello, I'm working with an 128x64 LCD screen and am using the Adafruit library Adafruit_SSD1306

In the code, it initialized the screen with the Adafruit splash screen. It's a pretty hefty burden on memory, but I like having this on start up. Below is how the byte array is stored in the library:

Here's a snippet from a program of mine. This is an array of infrared remote codes stored in PROGMEM, but it will show you how to do it for any other type of data:

///////////////////////////////////////////////////////////////////////////////
// Sony camera shutter release code 0xB4B8F (focus and shoot)
///////////////////////////////////////////////////////////////////////////////
static const uint16_t shutter[] PROGMEM = {
    // header
    0x8060, 0x0018,
    // data
    0x8030, 0x0018, 0x8018, 0x0018, 0x8030, 0x0018, 0x8030, 0x0018, // B
    0x8018, 0x0018, 0x8030, 0x0018, 0x8018, 0x0018, 0x8018, 0x0018, // 4
    0x8030, 0x0018, 0x8018, 0x0018, 0x8030, 0x0018, 0x8030, 0x0018, // B
    0x8030, 0x0018, 0x8018, 0x0018, 0x8018, 0x0018, 0x8018, 0x0018, // 8
    0x8030, 0x0018, 0x8030, 0x0018, 0x8030, 0x0018, 0x8030, 0x01C8, // F
    // end of data block
    0x0000
};

Note that I am storing UINT16_T values, whereas you need UINT8_T... just change it.

Also note that you will have to read this data using "pgm_read_byte (pointer + index)" instead of just accessing the array directly as you do from SRAM:

uint8_t array_size = sizeof (array) / sizeof (*array); // uint16_t if array > 255 elements
uint8_t index; // uint16_t if array > 255 elements
uint16_t data; // same type as data in array

for (index = 0; index < array_size; index++) {
    data = pgm_read_word(array + index); // pgm_read_byte for 8 bit data!
    // send data wherever
}

Hope this helps.