That doc seems to address:
- mulitdemensional arrays in PROGMEM (good)
- array of pointers to STRINGS (each defined on their own)
but it doesn't seem to cover an array of pointers to another array.
From that article it shows how to use pointers to string_table but it never shows how to retrieve a value from mydata[11][10] using a pointer from a table. I want to have something like mydata1, mydata2, etc and then a pointer to that table where I could call *myTablePointer[0][0] should give us the 1st value frfom the mydata1 table.
I can't figure out why this won't work ....I'm still stumped trying to figure this key piece out:
uint8_t line = pgm_read_word(table_pointers[fontnum]+(c*(myFontWidth*2))+i);
The way I read this is that the 1st line is getting the ‘i’ array from string_table and then we’re using a pointer to that + j to get the value. I’m not sure why we have all the PROGMEMs in there but I’ll take it at face value.
If this is what you have, then the statement you mention will not work because you are reading from program memory only once, not twice as is needed. Something like this should be better:
since table_pointers[] is itself in progmem, you must use pgm_read_word to get the pointer value to the sub-table. Then compute your offset into the sub-table, and pgm_read_word that.