PROGMEM Problem

I have already defined

const char weekDay[7][4] PROGMEM = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};

But can anyone help me figure out how to read the data suppose SUN from the variable weekDay.

Thanks to all in advance.

The Arduino documentation does address this.

Have seen the documentation but can't figure out the code to access the data from my variable. Can you please help me out?

Thank you.

That could be because it's not possible to do it the way you are doing it. PROGMEM works through intermediate loader functions, so it can't automatically index multidimensional arrays. Use the method shown in the documentation to set up a table of string pointers.

This will definitely help you.

something with strcpy_P

char wd[4];
strcpy_P(wd, weekDay[0]);

Not tested.

You could also do something like

const char weekDay[] PROGMEM = {"SUN\0MON\0TUE\0WED\0THU\0FRI\0SAT"};

Then do your own indexing calculations to yield the correct PROGMEM pointer to pass to strcpy_P().