Hi all! I've a really strange error with my Arduino. I'm developing an application wich includes a LCD menu to configure settings of the system.
I register the position of the menu where I'm and call a function passing the position to retrieve the text to show. The function is this:
char* Line1(int _PosMenu){
switch(_PosMenu){
case 0: return "";
case 1: return "My Text1";
case 2: return "My Text2";
case 3: return "My Text3";
case 4: return "My Text4";
case 5: return "My Text5";
case 6: return "My Text6";
case 7: return "";
case 8: return "";
case 9: return "";
case 10: return "My Text10";
[...]
case 17: return "My Text17";
[...]
case 39: return "My Text39";
case 40: return "My Text40";
}
}
Look that in some cases (0,7,8,9) it returns nothing because the option menu needs no text.
THE problem: When I call Line1(17) I get "My Teüt17" instead of "My Text17" :o
The rest of the texts arre returned correctly just this one is "out of law".
I've tried this change in the code:
case 17: return "My Te";
But in this case what I get when call Line1(17) is "My Te'My Text20". It looks like if the returned text has no line feed and it gets some garbage text from around.
My (strange) hypothesis is this: code is stored in the flash and for some reason the position of the memory where 'x' of line 17 is stored is overwrited with some character anywhere in the code. :-/
Anyone can give some light to solve "the ü expedient"
Thanks