Okay, thought I had this licked but.......
having issues with SMS1 not storing now and thought I had all three working earlier.
updated to void Current() // when run it prints out the 3 stored values.
void Current()
{
/*Serial.println("Current Mobile No:");
}
eeprom_read_string(0, buf, BUFSIZE);
Serial.println(buf);
Serial.println("Current Mobile No 2:");
eeprom_read_string(11, buf, BUFSIZE);
Serial.println(buf);*/
//
int i;
for (i = 0; i < 3; i++) {
Serial.print("Current Mobile No:");
Serial.println(i+1);
eeprom_read_string((i*11), buf, BUFSIZE);
Serial.println(buf);
}
}
created a TestLoop() rather than edit the existing number()
code below:- // this should allow the three numbers to be inputed into EEPROM, however currently only appears to be work for 2 and 3, confirmation and possible solutions appreciated, or what to look at.
void TestLoop()
{
int i;
for (i = 0; i < 3; i++) {
Serial.print("Input Mobile Number: ");
Serial.println(i+1);
while(Serial.available()==0){}//wait for user input
no1 = Serial.readString(); //read input
Serial.println(i+1);
Serial.println(no1);
if(no1.startsWith("SMS"+((i+1)),0)){
delay(20);
Serial.print("Saving variable string to address: ");
Serial.println(i*11);
delay(20);
no1s = no1.substring(4);
myString=no1s;
delay(20);
myString.toCharArray(myStringChar, BUFSIZE); //convert string to char array
strcpy(buf, myStringChar);
delay(20);
eeprom_write_string((i*11), buf);
delay(20);
Serial.print("Reading string from address : ");
Serial.println(i*11);
eeprom_read_string((i*11), buf, BUFSIZE);
Serial.println(buf);
delay(20);
}
}
}