PROGMEM Question

I have a question about reading my multidimensional array when used in the function. When I read my arrays when stored in RAM I don’t have any issues but when I do this I cannot read my arrays. Don’t understand why? Thank you.

PROGMEM  uint16_t LEDAll[8][8]  =  {{1, 1, 1, 1, 1, 1, 1, 1},  {1, 1, 1, 1, 1, 1, 1, 1},  {1, 1, 1, 1, 1, 1, 1, 1},  {1, 1, 1, 1, 1, 1, 1, 1}, 
                                    {1, 1, 1, 1, 1, 1, 1, 1},  {1, 1, 1, 1, 1, 1, 1, 1},  {1, 1, 1, 1, 1, 1, 1, 1},  {1, 1, 1, 1, 1, 1, 1, 1}};
PROGMEM  uint16_t LEDOff[8][8]  =  {{0, 0, 0, 0, 0, 0, 0, 0},  {0, 0, 0, 0, 0, 0, 0, 0},  {0, 0, 0, 0, 0, 0, 0, 0},  {0, 0, 0, 0, 0, 0, 0, 0}, 
	                            {0, 0, 0, 0, 0, 0, 0, 0},  {0, 0, 0, 0, 0, 0, 0, 0},  {0, 0, 0, 0, 0, 0, 0, 0},  {0, 0, 0, 0, 0, 0, 0, 0}};


void loop()//main function 
{ 
  lightLED(LEDAll);
  delay(1000);
  lightLED(LEDOff);
 
} 

void lightLED(uint16_t tempLED[8][8]) 
{ 
  uint16_t temp;
  temp = pgm_read_word(&(tempLED[8][8]));
 
  byte columnbitsToSend ;
  byte rowbitsToSend ;
  
  int x = 0;
  int y = 0;
    for (x = 0; x < 8; x++) 
    {
    columnbitsToSend = 0;
    rowbitsToSend = 0;
    for (y = 0; y < 8; y ++) 
    {
 if   (tempLED[x][y] == 1) 
 { 
   bitWrite(rowbitsToSend, y, HIGH);
 } 
    }
    
    digitalWrite(latchPin, LOW);
    bitWrite(columnbitsToSend, x, HIGH);
    shiftOut(dataPin, clockPin, MSBFIRST, columnbitsToSend);
    shiftOut(dataPin, clockPin, MSBFIRST, rowbitsToSend);
    digitalWrite(latchPin, HIGH);   
    delay(1);
  }
  
}

Progmem is rather strange, perhaps because it is not part of C++ but is an AVR extension. I've not used multidimensional arrays in progmem yet, but I suggest you try this:

static const prog_uint16_t LEDAll[8][8] PROGMEM = {{1, 1, 1, 1, 1, 1, 1, 1},  {1, 1, 1, 1, 1, 1, 1, 1},  {1, 1, 1, 1, 1, 1, 1, 1},  {1, 1, 1, 1, 1, 1, 1, 1}, 
                                    {1, 1, 1, 1, 1, 1, 1, 1},  {1, 1, 1, 1, 1, 1, 1, 1},  {1, 1, 1, 1, 1, 1, 1, 1},  {1, 1, 1, 1, 1, 1, 1, 1}};

PS - I just noticed that

temp = pgm_read_word(&(tempLED[8][8]));

is invalid because tempLED has bounds [8][8] so the maximum legal index is [7][7]. Also, tempLED should be declared with type prog_uint16_t[8][8].

Thank you for the post. This is my first time as well and I just cannot figure it out. I have no clue why it is not working. I have been struggling for several days now. I will try this and let you know. The thing is it works just fine when I store the data in RAM. I don’t think it is an issue of me storing it but the extraction from FLASH is what is puzzling me.

btw using my suggestion, you'll also need to declare the types of any parameters that you pass those progmem arrays to as 'const prog_uint16_t[8][8]' also.