Hi!
I'm trying to find the solution for days now, this forum is my last chance.
Description: I try to make a "hardware" with 2x16 LCD, it stores fixed 16char long strings in EEPROM. At program start it loads the EEPROM to array, and writes the one which is selected with rotary switch. Here is my piece of code.
I made a writing out to LCD at loading the EEPROM, for debugging.
This is how I declared memoryname array:
char* memoryname[]={" ",
" ",
" ",
" "};
This is how i load the EEPROM data (maxmem is the number of strings 3 in this case, string1 is stored at eeprom 24-39, string2: 44-59, etcetc):
void read_eeprom_memory (){
byte i = 0;
byte j = 0;
char tempstring[16] ;
maxmem = EEPROM.read(9);
for (i = 1; i<=maxmem; i++){
for (j=0; j<16; j++){
tempstring[j] = EEPROM.read((i*20)+4+j);
}
lcd.clear();
lcd.setCursor(0,0);
lcd.print(tempstring);
memoryname[i] = tempstring;
lcd.setCursor(0,1);
lcd.print(memoryname[i]);
delay(3000);
}
}
When this runs at startup, I can see the correct strings on both of the lines on the LCD.
In the loop{} if I try to write theese strings to LCD i get some messy characters:
lcd.print(memoryname[memapointer]);
memapointer stores, which mode we are in. Changed via rotary encoder values can be 1..3.
Why do I get some messy characters in the main loop (see attached picture, the string should be in the lower line)?
Thanks