First of all, hi there, thanks that you are reading this.
If you could help me out a bit or point me at least in the direction the error is located i would really appreciate.
Alright, here the Problem:
I have a const PROGMEM char - (2D)-Array to store '\0' - terminated strings in.
const PROGMEM char VARIABLE_STRINGS[30][20] =
{
"Some Example\0", //shortened version
"some other\0",
"another one\0"
};
So far so good. I can print all my chars by "Serial.print(VARIABLE_STRINGS[X][Y]);"
As i tried to iterate-print a string, i get problems.
My first thought was: "gonna be easy, just use "Serial.print(VARIABLE_STRINGS[X]);"
Which apparently returns me some gibberish of other parts of the memory i sometimes even recognize, but are outside of the char arrays memory.
It gets weirder. If i try to just print a single char from the array by telling it its X and Y to look, it returns the char perfectly fine. Once i put it in a loop and iterate it, it just returns random memory values.
Serial.print(VARIABLE_STRINGS[0][0]); // works
//------------------------------------------------
for (int i = 0; i < Var1; i++){ // does not work, returns
for (int j = 0; j < Var2; j++){ // "random" memory-data
Serial.print(VARIABLE_STRINGS[i][j]);
}
}
The Serial is working fine, everything is printed the intended way, only my 1D-CHAR-ARRAY copied from 2D-CHAR-ARRAY wont print.
Weirder: i can even use "strcasecmp" to compare them and get the right results, which shows me that the variables are set alright, i guess.
So the problem might have to be in me trying to Serial.print(); it... but what am i doing wrong?
Thanks for help in advance
Felix