Hey guys and gals,
I'm having yet another issue / stumbling block learning about 2D arrays.
I'm trying to copy the entire contents of an array which is stored in progmem into another array as shown here.
Arrays are stored like this.
volatile unsigned int arrayy[8][8] = {
{B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111},
{B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111},
{B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111},
{B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111},
{B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111},
{B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111},
{B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111},
{B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111},
};
const int arrayx[8][8] PROGMEM = {
{B11111111, B10000001, B10000001, B10000001, B10000001, B10000001, B10000001, B11111111},
{B10000001, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B10000001},
{B10000001, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B10000001},
{B10000001, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B10000001},
{B10000001, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B10000001},
{B10000001, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B10000001},
{B10000001, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B10000001},
{B11111111, B10000001, B10000001, B10000001, B10000001, B10000001, B10000001, B11111111},
};
Now if it were just an array stored in the dynamic memory I would use a for loop to transfer the data from array x into array y like this.
for(int l = 0; l < 8; l ++){
for(int m = 0; m < 8; m++){
arrayy[l][m] = arrayx[l][m];
needless to say its not quite as easy when pulling it from the progmem space.
Can anyone point me in the right direction on this?
Kind regards,
Unordung