I'm running out of dynamic memory and therefore trying to put a multidimensional array of uint8_t values into PROGMEM.
Declared as global const the code runs fine. Pulling back the values from PROGMEM the values are not correct. I get no compile error.
Code that works...
const uint8_t numDotBytes[5][5] =
{{126,129,129,129,126},
{0,130,255,128,0},
{130,193,161,145,142},
{66,129,137,137,118},
{24,20,18,255,16}};
void setup ()
{
Serial.begin (115200);
Serial.println ();
Serial.print (F("Array Element 3, 0 - 4 "));
for (int i = 0; i < 5; i++) {
Serial.print (numDotBytes[3][i]);Serial.print(",");
}
}
void loop() {
}
Code that does not work.
extern const uint8_t numDotBytes[5][5] PROGMEM;
void setup ()
{
Serial.begin (115200);
Serial.println ();
Serial.print (F("Array Element 3, 0 - 4 "));
for (int i = 0; i < 5; i++) {
Serial.print (numDotBytes[3][i]);Serial.print(",");
}
}
void loop() {
}
const uint8_t numDotBytes[5][5] PROGMEM =
{{126,129,129,129,126},
{0,130,255,128,0},
{130,193,161,145,142},
{66,129,137,137,118},
{24,20,18,255,16}};
I'm sure it is something I just don't understand, but have not found a solution in my search.