What's PROGMEM for?

Hi Guys, i was wondering what's PROGMEM for? I've read somewhere that it makes the Arduino use the Flash memory instead of SRAM. I need something like this in my project. also, where can i apply PROGMEM? i've tried adding to to variables, but i noticed it only works well with constants.

thanks! :slight_smile:

  • mIgs

The 328 microcontroller has 32k of flash memory, 1k of EEPROM and 2k of RAM. For read-only data you have the option of putting it in the flash memory (which is effectively read-only except when uploading a program) to save space in RAM. PROGMEM is the compiler directive to say "put this data in flash, not RAM".

Note that flash memory can be written, but only a page at a time, and its slow.

oh. noticed that it both bugs and makes my program work. 1st, my program does not respond without PROGMEM, but when i add PROGMEM, it responds, just not the way i want it to.

any idea why this happens?

Without having any clue as to what your program does, not really.

No.

Hint: What program?

Here’s what i’m working on. it’s a SMS-based LED MATRIX display. whenever i text something to the Arduino GSM module, it would display the text on the LED matrix. Both work well separately, but when i combine the codes, it doesn’t respond both physically and on the Serial Monitor.

I noticed that they can’t work simultaneously, but when i added PROGMEM, it did. however, the message i sent to the LED matrix was kinda messy. for example, I sent a letter “L” to the matrix, and it displayed a distorted L instead. any ideas why? this is where i added PROGMEM:

#include <avr/pgmspace.h>

const unsigned char character_data[][6] PROGMEM =
{
  
    { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },       //20-
    { 0x00, 0x00, 0x00, 0xF2, 0x00, 0x00 },       //21-!
    { 0x00, 0x00, 0xE0, 0x00, 0xE0, 0x00 },       //22-"
    { 0x28, 0xFE, 0x28, 0xFE, 0x28, 0x00 },       //23-#
    { 0x24, 0x54, 0x7E, 0x54, 0x48, 0x00 },       //24-$
    { 0xC4, 0xC4, 0x10, 0x26, 0x46, 0x00 },       //25-%
    { 0x6C, 0x92, 0xAA, 0x44, 0x1A, 0x00 },       //26-&
    { 0x00, 0x00, 0xA0, 0xC0, 0x00, 0x00 },       //27-'
    { 0x00, 0x00, 0x38, 0x44, 0x82, 0x00 },       //28-(
    { 0x00, 0x82, 0x44, 0x38, 0x00, 0x00 },       //29-)
    { 0x28, 0x10, 0x6C, 0x10, 0x28, 0x00 },       //2A-*
    { 0x10, 0x10, 0x6C, 0x10, 0x10, 0x00 },       //2B-+
    { 0x00, 0x00, 0x0A, 0x0C, 0x00, 0x00 },       //2C-,
    { 0x10, 0x10, 0x10, 0x10, 0x10, 0x00 },       //2D--
    { 0x00, 0x00, 0x06, 0x06, 0x00, 0x00 },       //2E-.
    { 0x04, 0x08, 0x10, 0x20, 0x40, 0x00 },       //2F-/
    { 0x7C, 0x82, 0x82, 0x82, 0x7C, 0x00 },       //30
    { 0x00, 0x42, 0xFE, 0x02, 0x00, 0x00 },       //31
    { 0x42, 0x86, 0x8A, 0x92, 0x62, 0x00 },       //32
    { 0x84, 0x82, 0xA2, 0xD2, 0x8C, 0x00 },       //33
    { 0x18, 0x28, 0x48, 0xFE, 0x08, 0x00 },       //34
    { 0xE4, 0xA2, 0xA2, 0xA2, 0x9C, 0x00 },       //35
    { 0x3C, 0x52, 0x92, 0x92, 0x0C, 0x00 },       //36
    { 0x80, 0x8E, 0x90, 0xA0, 0xC0, 0x00 },       //37
    { 0x6C, 0x92, 0x92, 0x92, 0x6C, 0x00 },       //38
    { 0x60, 0x92, 0x92, 0x94, 0x78, 0x00 },       //39
    { 0x00, 0x00, 0x6C, 0x6C, 0x00, 0x00 },       //3A-:
    { 0x00, 0x00, 0x6A, 0x6C, 0x00, 0x00 },       //3B-//
    { 0x00, 0x10, 0x28, 0x44, 0x82, 0x00 },       //3C-<
    { 0x28, 0x28, 0x28, 0x28, 0x28, 0x00 },       //3D-=
    { 0x00, 0x82, 0x44, 0x28, 0x10, 0x00 },       //3E->
    { 0x40, 0x80, 0x8A, 0x90, 0x60, 0x00 },       //3F-?
    { 0x7C, 0x82, 0xBA, 0xAA, 0xBA, 0x70 },       //40-@
    { 0x7E, 0x88, 0x88, 0x88, 0x7E, 0x00 },       //41-A
    { 0xFE, 0x92, 0x92, 0x92, 0x6C, 0x00 },       //42-B
    { 0x7C, 0x82, 0x82, 0x82, 0x44, 0x00 },       //43-C
    { 0xFE, 0x82, 0x82, 0x44, 0x38, 0x00 },       //44-D
    { 0xFE, 0x92, 0x92, 0x92, 0x82, 0x00 },       //45-E
    { 0xFE, 0x90, 0x90, 0x90, 0x80, 0x00 },       //46-F
    { 0x7C, 0x82, 0x92, 0x92, 0x5E, 0x00 },       //47-G
    { 0xFE, 0x10, 0x10, 0x10, 0xFE, 0x00 },       //48-H
    { 0x00, 0x82, 0xFE, 0x82, 0x00, 0x00 },       //49-I
    { 0x04, 0x02, 0x82, 0xFC, 0x80, 0x00 },       //4A-J
    { 0xFE, 0x10, 0x28, 0x44, 0x82, 0x00 },       //4B-K
    { 0xFE, 0x02, 0x02, 0x02, 0x02, 0x00 },       //4C-L
    { 0xFE, 0x40, 0x30, 0x40, 0xFE, 0x00 },       //4D-M
    { 0xFE, 0x20, 0x10, 0x08, 0xFE, 0x00 },       //4E-N
    { 0x7C, 0x82, 0x82, 0x82, 0x7C, 0x00 },       //4F-O
    { 0xFE, 0x90, 0x90, 0x90, 0x60, 0x00 },       //50-P
    { 0x7C, 0x82, 0x8A, 0x84, 0x7A, 0x00 },       //51-Q
    { 0xFE, 0x90, 0x98, 0x94, 0x62, 0x00 },       //52-R
    { 0x62, 0x92, 0x92, 0x92, 0x8C, 0x00 },       //53-S
    { 0x80, 0x80, 0xFE, 0x80, 0x80, 0x00 },       //54-T
    { 0xFC, 0x02, 0x02, 0x02, 0xFC, 0x00 },       //55-U
    { 0xF8, 0x04, 0x02, 0x04, 0xF8, 0x00 },       //56-V
    { 0xFC, 0x02, 0x1C, 0x02, 0xFC, 0x00 },       //57-W
    { 0xC6, 0x28, 0x10, 0x28, 0xC6, 0x00 },       //58-X
    { 0xE0, 0x10, 0x0E, 0x10, 0xE0, 0x00 },       //59-Y
    { 0x86, 0x8A, 0x92, 0xA2, 0xC2, 0x00 },       //5A-Z
    { 0x00, 0x00, 0xFE, 0x82, 0x82, 0x00 },       //5B-[
    { 0x40, 0x20, 0x10, 0x08, 0x04, 0x00 },       //5C-\

    { 0x00, 0x82, 0x82, 0xFE, 0x00, 0x00 },       //5D-]
    { 0x20, 0x40, 0xFE, 0x40, 0x20, 0x00 },       //5E-^
    { 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 },       //5F-_
    { 0x80, 0x40, 0x20, 0x00, 0x00, 0x00 },       //60-`
    { 0x04, 0x2A, 0x2A, 0x2A, 0x1E, 0x00 },       //61-a
    { 0xFE, 0x12, 0x22, 0x22, 0x1C, 0x00 },       //62-b
    { 0x1C, 0x22, 0x22, 0x22, 0x04, 0x00 },       //63-c
    { 0x1C, 0x22, 0x22, 0x12, 0xFE, 0x00 },       //64-d
    { 0x1C, 0x2A, 0x2A, 0x2A, 0x18, 0x00 },       //65-e
    { 0x08, 0x3F, 0x48, 0x40, 0x20, 0x00 },       //66-f
    { 0x18, 0x25, 0x25, 0x25, 0x3E, 0x00 },       //67-g
    { 0xFE, 0x10, 0x20, 0x20, 0x1E, 0x00 },       //68-h
    { 0x00, 0x22, 0xBE, 0x02, 0x00, 0x00 },       //69-i
    { 0x02, 0x01, 0x21, 0xBE, 0x00, 0x00 },       //6A-j
    { 0x00, 0xFE, 0x08, 0x14, 0x22, 0x00 },       //6B-k
    { 0x00, 0x82, 0xFE, 0x02, 0x00, 0x00 },       //6C-l
    { 0x3E, 0x20, 0x18, 0x20, 0x1E, 0x00 },       //6D-m
    { 0x3E, 0x10, 0x20, 0x20, 0x1E, 0x00 },       //6E-n
    { 0x1C, 0x22, 0x22, 0x22, 0x1C, 0x00 },       //6F-o
    { 0x3F, 0x24, 0x24, 0x24, 0x18, 0x00 },       //70-p
    { 0x18, 0x24, 0x24, 0x14, 0x3F, 0x00 },       //71-q
    { 0x3E, 0x10, 0x20, 0x20, 0x10, 0x00 },       //72-r
    { 0x12, 0x2A, 0x2A, 0x2A, 0x04, 0x00 },       //73-s
    { 0x20, 0xFC, 0x22, 0x02, 0x04, 0x00 },       //74-t
    { 0x3C, 0x02, 0x02, 0x04, 0x3E, 0x00 },       //75-u
    { 0x38, 0x04, 0x02, 0x04, 0x38, 0x00 },       //76-v
    { 0x3C, 0x02, 0x0C, 0x02, 0x3C, 0x00 },       //77-w
    { 0x22, 0x14, 0x08, 0x14, 0x22, 0x00 },       //78-x
    { 0x38, 0x05, 0x05, 0x05, 0x3E, 0x00 },       //79-y
    { 0x22, 0x26, 0x2A, 0x32, 0x22, 0x00 },       //7A-z
    { 0x00, 0x10, 0x6C, 0x82, 0x00, 0x00 },       //7B-{
    { 0x00 },                                     //7C-|-BLANK BAR
    { 0x00, 0x82, 0x6C, 0x10, 0x00, 0x00 },       //7D-}
    { 0x18, 0x24, 0x7E, 0x24, 0x08, 0x00 },
    { 0 }                                         //7F-DO NOT USE

};

char *announcement(int message_no1)
{
  char *LED_message[]={"  L  "};
      
  return LED_message[message_no1];
}

Follow my advice on your other topic, you are using pointers when you shouldn't :slight_smile:

Also you don't use "character_data" in this part of your program, and we need to see where you use it.

guix:
Follow my advice on your other topic, you are using pointers when you shouldn’t :slight_smile:

Also you don’t use “character_data” in this part of your program, and we need to see where you use it.

here’s where i use Character_data:

void load(void)
{
  int i = 0;
  int counter1;
  char *LED_DATA = announcement(message_no);                   
  char *LED_DATA2 = fromSMS[msg_count];
  
  Serial.print("SMS DATA: ");
  Serial.println(LED_DATA);
  Serial.print("LED DATA: ");
  Serial.println(smsdata);
  
  if(LED_DATA[char_pointer]  == '\0')
  {
    char_pointer = 0;
 //   message_no++;
  }

  for(counter1 = 0; counter1 < 5; counter1++)
  {
    Display_Ram[32 + counter1] = character_data[(LED_DATA[char_pointer] - 0x20)][counter1];
  }
  
 // if(message_no > 1)
  {
 //   message_no = 0;
  }
  
  Display_Ram[37] = 00;	
  char_pointer++;

}

I’m not really good at pointers, i just followed some examples online. can you help me please? :frowning: the deadline for this project is really near. :frowning: i attached my code. I would really appreciate your help. thank you!

  • migs

new_again.rar (2.73 KB)

Have you read any of the documentation on PROGMEM? If not, start with PROGMEM - Arduino Reference.

dxw00d:
Have you read any of the documentation on PROGMEM? If not, start with http://arduino.cc/en/Reference/PROGMEM.

yes, and i think it does not fit my project. :frowning: any ideas? I’m thinking it’s because of the SRAM memory.

I would really appreciate your help guys. :slight_smile:

It explains almost exactly what you need to do if you look closely…

For a PROGMEM string, you can’t access it like a normal array. This is wrong:

  for(counter1 = 0; counter1 < 5; counter1++)
  {
    Display_Ram[32 + counter1] = character_data[(LED_DATA[char_pointer] - 0x20)][counter1];
  }

Instead as explained you have to use the pgm_read_byte_near() or pgm_read_word() functions to fetch the data from the program memory.
There are two ways. The simplest is to convert your code to use pgm_read_byte_near():

  for(counter1 = 0; counter1 < 5; counter1++)
  {
    int index = (LED_DATA[char_pointer] - 0x20)*6 +counter1; //Basically this is what the array index "[(LED_DATA[char_pointer] - 0x20)][counter1]" works out. Where 6 is the length of the last dimension of the array.
    Display_Ram[32 + counter1] = pgm_read_byte_near(character_data + index); //read the byte at this location
  }

Another option which is slightly tidier is to use the strcpy_P() function as explained in the section about strings. What it doesn’t mention is that this function has a friend strncpy_P() which performs the same function, except that it only copies n characters.

  strncpy_P(&Display_Ram[32],(char*)pgm_read_word(&(character_data[(LED_DATA[char_pointer] - 0x20)])),6); //Copy the six characters from the given row of the array to 32 bytes after the start of Display_Ram

(Note this is untested)

I tried out your advice, but there are still some errors in the display. I’m wondering if i could really use PROGMEM for this:

#include <avr/pgmspace.h>

const unsigned char character_data[][6] PROGMEM=
{

when the 2 dimentions of the array must be changed in order to be accessed. does this affect anything?

The dimensions of the array don’t change. They are fixed.

What you are trying to do is access variables within the array which is not an issue.

Just as a side note, there is a third way of doing this (simper than the first, more lines of code than the second):

  for(counter1 = 0; counter1 < 5; counter1++)
  {
    Display_Ram[32 + counter1] = pgm_read_byte(&(character_data[(LED_DATA[char_pointer] - 0x20)][counter1])); //read the byte at this location
  }

THANK YOU! I GOT IT WORKING! :slight_smile: YOU GUYS ARE GREAT!

I’ll post the code once i do some more improvements and some housekeeping. :slight_smile:

I COULDN’T HAVE DONE THIS PROJECT WITHOUT THE ARDUINO COMMUNITY’S HELP. :slight_smile:

thank you!

  • Migs

hi! i have another question. I’d like to use an array that contains array like this

#include <SIM900.h>
#include <sms.h>
#include <SoftwareSerial.h>

char smsdata[160];
char numberRx[20];
int i = 0;
int x = 0;
int y;
char *inbox[5][10];

void setup()
{
  Serial.begin(9600);
  gsm.begin(4800);
}

void loop()
{
  checkSMS();
}

void checkSMS()
{
  if(gsm.readSMS(smsdata, 160, numberRx, 20))
  {
    Serial.print("SMS Recieved: ");
    while (smsdata[i+1] != '\0')
    {
      Serial.print(smsdata[i]);
      i++;
    }
    i = 0;
    Serial.println("");
    inbox[x][y] = strdup(smsdata);
    x++;
    store();
  }
  else
  {
    Serial.println("No Messages");
  }
}

void store()
{
  int y;
    
  if (x == 5)
  {
    x = 0;
  }
    
  Serial.print("Inbox 1: ");
  Serial.println(inbox[0][y]);
  Serial.print("Inbox 2: ");
  Serial.println(inbox[1][y]);
  Serial.print("Inbox 3: ");
  Serial.println(inbox[2][y]);
  Serial.print("Inbox 4: ");
  Serial.println(inbox[3][y]);
  Serial.print("Inbox 5: ");
  Serial.println(inbox[4][y]); 

}

and use “inbox” instead of LED_DATA this line of code:

for(counter1 = 0; counter1 < 5; counter1++)
  {
    Display_Ram[32 + counter1] = pgm_read_byte(&(character_data[(LED_DATA[char_pointer] - 0x20)][counter1])); //read the byte at this location
  }

doesn’t seem to work. any idea why? and how can i fix this problem?

char *inbox[5][10];

This is a two dimensional array of pointers.

LED_DATA appears to be a one dimensional array of non-pointers.

A 2D array of pointers and a 1D array of non-pointers are 2 orders of magnitude different.

PaulS:
LED_DATA appears to be a one dimensional array of non-pointers.

A 2D array of pointers and a 1D array of non-pointers are 2 orders of magnitude different.

i also tried using a 1D array.

#include <SIM900.h>
#include <sms.h>
#include <SoftwareSerial.h>

char smsdata[160];
char numberRx[20];
int i = 0;
int x = 0;
int y;
char *inbox[5];

void setup()
{
  Serial.begin(9600);
  gsm.begin(4800);
}

void loop()
{
  checkSMS();
}

void checkSMS()
{
  if(gsm.readSMS(smsdata, 160, numberRx, 20))
  {
    Serial.print("SMS Recieved: ");
    while (smsdata[i+1] != '\0')
    {
      Serial.print(smsdata[i]);
      i++;
    }
    i = 0;
    Serial.println("");
    inbox[x] = strdup(smsdata);
    x++;
    store();
  }
  else
  {
    Serial.println("No Messages");
  }
}

void store()
{
  int y;
    
  if (x == 5)
  {
    x = 0;
  }
    
  Serial.print("Inbox 1: ");
  Serial.println(inbox[0]);
  Serial.print("Inbox 2: ");
  Serial.println(inbox[1]);
  Serial.print("Inbox 3: ");
  Serial.println(inbox[2]);
  Serial.print("Inbox 4: ");
  Serial.println(inbox[3]);
  Serial.print("Inbox 5: ");
  Serial.println(inbox[4]); 

}

but when i applied it to this:

for(counter1 = 0; counter1 < 5; counter1++)
  {
    Display_Ram[32 + counter1] = pgm_read_byte(&(character_data[(LED_DATA[char_pointer] - 0x20)][counter1])); //read the byte at this location
  }

It still didn’t work. can you please help me out? i really need this. the deadline’s on monday. :frowning:

i’m almost done with this, i’m 95% complete. thanks!

He’res a video of what’ve done so far:

Are you trying to use pgm_read_byte() on your inbox array? The inbox array is in SRAM, not PROGMEM.

dxw00d:
Are you trying to use pgm_read_byte() on your inbox array? The inbox array is in SRAM, not PROGMEM.

yes, i used PROGMEM to store my CMAP.H in SRAM.

#include <avr/pgmspace.h>

const unsigned char character_data[][6] PROGMEM =
{
  
    { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },       //20-
    { 0x00, 0x00, 0x00, 0xF2, 0x00, 0x00 },       //21-!
    { 0x00, 0x00, 0xE0, 0x00, 0xE0, 0x00 },       //22-"
    { 0x28, 0xFE, 0x28, 0xFE, 0x28, 0x00 },       //23-#
    { 0x24, 0x54, 0x7E, 0x54, 0x48, 0x00 },       //24-$
    { 0xC4, 0xC4, 0x10, 0x26, 0x46, 0x00 },       //25-%
    { 0x6C, 0x92, 0xAA, 0x44, 0x1A, 0x00 },       //26-&
    { 0x00, 0x00, 0xA0, 0xC0, 0x00, 0x00 },       //27-'
    { 0x00, 0x00, 0x38, 0x44, 0x82, 0x00 },       //28-(
    { 0x00, 0x82, 0x44, 0x38, 0x00, 0x00 },       //29-)
    { 0x28, 0x10, 0x6C, 0x10, 0x28, 0x00 },       //2A-*
    { 0x10, 0x10, 0x6C, 0x10, 0x10, 0x00 },       //2B-+
    { 0x00, 0x00, 0x0A, 0x0C, 0x00, 0x00 },       //2C-,
    { 0x10, 0x10, 0x10, 0x10, 0x10, 0x00 },       //2D--
    { 0x00, 0x00, 0x06, 0x06, 0x00, 0x00 },       //2E-.
    { 0x04, 0x08, 0x10, 0x20, 0x40, 0x00 },       //2F-/
    { 0x7C, 0x82, 0x82, 0x82, 0x7C, 0x00 },       //30
    { 0x00, 0x42, 0xFE, 0x02, 0x00, 0x00 },       //31
    { 0x42, 0x86, 0x8A, 0x92, 0x62, 0x00 },       //32
    { 0x84, 0x82, 0xA2, 0xD2, 0x8C, 0x00 },       //33
    { 0x18, 0x28, 0x48, 0xFE, 0x08, 0x00 },       //34
    { 0xE4, 0xA2, 0xA2, 0xA2, 0x9C, 0x00 },       //35
    { 0x3C, 0x52, 0x92, 0x92, 0x0C, 0x00 },       //36
    { 0x80, 0x8E, 0x90, 0xA0, 0xC0, 0x00 },       //37
    { 0x6C, 0x92, 0x92, 0x92, 0x6C, 0x00 },       //38
    { 0x60, 0x92, 0x92, 0x94, 0x78, 0x00 },       //39
    { 0x00, 0x00, 0x6C, 0x6C, 0x00, 0x00 },       //3A-:
    { 0x00, 0x00, 0x6A, 0x6C, 0x00, 0x00 },       //3B-//
    { 0x00, 0x10, 0x28, 0x44, 0x82, 0x00 },       //3C-<
    { 0x28, 0x28, 0x28, 0x28, 0x28, 0x00 },       //3D-=
    { 0x00, 0x82, 0x44, 0x28, 0x10, 0x00 },       //3E->
    { 0x40, 0x80, 0x8A, 0x90, 0x60, 0x00 },       //3F-?
    { 0x7C, 0x82, 0xBA, 0xAA, 0xBA, 0x70 },       //40-@
    { 0x7E, 0x88, 0x88, 0x88, 0x7E, 0x00 },       //41-A
    { 0xFE, 0x92, 0x92, 0x92, 0x6C, 0x00 },       //42-B
    { 0x7C, 0x82, 0x82, 0x82, 0x44, 0x00 },       //43-C
    { 0xFE, 0x82, 0x82, 0x44, 0x38, 0x00 },       //44-D
    { 0xFE, 0x92, 0x92, 0x92, 0x82, 0x00 },       //45-E
    { 0xFE, 0x90, 0x90, 0x90, 0x80, 0x00 },       //46-F
    { 0x7C, 0x82, 0x92, 0x92, 0x5E, 0x00 },       //47-G
    { 0xFE, 0x10, 0x10, 0x10, 0xFE, 0x00 },       //48-H
    { 0x00, 0x82, 0xFE, 0x82, 0x00, 0x00 },       //49-I
    { 0x04, 0x02, 0x82, 0xFC, 0x80, 0x00 },       //4A-J
    { 0xFE, 0x10, 0x28, 0x44, 0x82, 0x00 },       //4B-K
    { 0xFE, 0x02, 0x02, 0x02, 0x02, 0x00 },       //4C-L
    { 0xFE, 0x40, 0x30, 0x40, 0xFE, 0x00 },       //4D-M
    { 0xFE, 0x20, 0x10, 0x08, 0xFE, 0x00 },       //4E-N
    { 0x7C, 0x82, 0x82, 0x82, 0x7C, 0x00 },       //4F-O
    { 0xFE, 0x90, 0x90, 0x90, 0x60, 0x00 },       //50-P
    { 0x7C, 0x82, 0x8A, 0x84, 0x7A, 0x00 },       //51-Q
    { 0xFE, 0x90, 0x98, 0x94, 0x62, 0x00 },       //52-R
    { 0x62, 0x92, 0x92, 0x92, 0x8C, 0x00 },       //53-S
    { 0x80, 0x80, 0xFE, 0x80, 0x80, 0x00 },       //54-T
    { 0xFC, 0x02, 0x02, 0x02, 0xFC, 0x00 },       //55-U
    { 0xF8, 0x04, 0x02, 0x04, 0xF8, 0x00 },       //56-V
    { 0xFC, 0x02, 0x1C, 0x02, 0xFC, 0x00 },       //57-W
    { 0xC6, 0x28, 0x10, 0x28, 0xC6, 0x00 },       //58-X
    { 0xE0, 0x10, 0x0E, 0x10, 0xE0, 0x00 },       //59-Y
    { 0x86, 0x8A, 0x92, 0xA2, 0xC2, 0x00 },       //5A-Z
    { 0x00, 0x00, 0xFE, 0x82, 0x82, 0x00 },       //5B-[
    { 0x40, 0x20, 0x10, 0x08, 0x04, 0x00 },       //5C-\

    { 0x00, 0x82, 0x82, 0xFE, 0x00, 0x00 },       //5D-]
    { 0x20, 0x40, 0xFE, 0x40, 0x20, 0x00 },       //5E-^
    { 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 },       //5F-_
    { 0x80, 0x40, 0x20, 0x00, 0x00, 0x00 },       //60-`
    { 0x04, 0x2A, 0x2A, 0x2A, 0x1E, 0x00 },       //61-a
    { 0xFE, 0x12, 0x22, 0x22, 0x1C, 0x00 },       //62-b
    { 0x1C, 0x22, 0x22, 0x22, 0x04, 0x00 },       //63-c
    { 0x1C, 0x22, 0x22, 0x12, 0xFE, 0x00 },       //64-d
    { 0x1C, 0x2A, 0x2A, 0x2A, 0x18, 0x00 },       //65-e
    { 0x08, 0x3F, 0x48, 0x40, 0x20, 0x00 },       //66-f
    { 0x18, 0x25, 0x25, 0x25, 0x3E, 0x00 },       //67-g
    { 0xFE, 0x10, 0x20, 0x20, 0x1E, 0x00 },       //68-h
    { 0x00, 0x22, 0xBE, 0x02, 0x00, 0x00 },       //69-i
    { 0x02, 0x01, 0x21, 0xBE, 0x00, 0x00 },       //6A-j
    { 0x00, 0xFE, 0x08, 0x14, 0x22, 0x00 },       //6B-k
    { 0x00, 0x82, 0xFE, 0x02, 0x00, 0x00 },       //6C-l
    { 0x3E, 0x20, 0x18, 0x20, 0x1E, 0x00 },       //6D-m
    { 0x3E, 0x10, 0x20, 0x20, 0x1E, 0x00 },       //6E-n
    { 0x1C, 0x22, 0x22, 0x22, 0x1C, 0x00 },       //6F-o
    { 0x3F, 0x24, 0x24, 0x24, 0x18, 0x00 },       //70-p
    { 0x18, 0x24, 0x24, 0x14, 0x3F, 0x00 },       //71-q
    { 0x3E, 0x10, 0x20, 0x20, 0x10, 0x00 },       //72-r
    { 0x12, 0x2A, 0x2A, 0x2A, 0x04, 0x00 },       //73-s
    { 0x20, 0xFC, 0x22, 0x02, 0x04, 0x00 },       //74-t
    { 0x3C, 0x02, 0x02, 0x04, 0x3E, 0x00 },       //75-u
    { 0x38, 0x04, 0x02, 0x04, 0x38, 0x00 },       //76-v
    { 0x3C, 0x02, 0x0C, 0x02, 0x3C, 0x00 },       //77-w
    { 0x22, 0x14, 0x08, 0x14, 0x22, 0x00 },       //78-x
    { 0x38, 0x05, 0x05, 0x05, 0x3E, 0x00 },       //79-y
    { 0x22, 0x26, 0x2A, 0x32, 0x22, 0x00 },       //7A-z
    { 0x00, 0x10, 0x6C, 0x82, 0x00, 0x00 },       //7B-{
    { 0x00 },                                     //7C-|-BLANK BAR
    { 0x00, 0x82, 0x6C, 0x10, 0x00, 0x00 },       //7D-}
    { 0x18, 0x24, 0x7E, 0x24, 0x08, 0x00 },
    { 0 }                                         //7F-DO NOT USE

};

char *announcement(int message_no1)
{
  char *LED_message[]={"    LCoES Announcements         ",
                       "    Hello Letranites!           "};
      
  return LED_message[message_no1];
}

Can you please help me out?

yes, i used PROGMEM to store my CMAP.H in SRAM.

But the inbox array is NOT in PROGMEM, so using the functions that read from PROGMEM to get data from inbox won't work.