actually, this two functions, readAnythingFromEEPROM and writeAnythingToEEPROM I saw in an another post some time ago, and use it a lot when need to store things in EEPROM.
From what I understand they take a parameter of any kind, and stores to EEPROM/reads from it. It always put the data on the beginning of the EEPROM, and uses as much space is needed.
If you run writeAnythingToEEPROM(something); and "something" is an string, the function will split the string in bytes and save in the EEPROM, but the "something" can be anything, can be for example an array of int, or even an structure
In your case you can, in just one line, save the whole array of char * with the command writeAnythingToEEPROM(savednumbers);
If you want to make the function start writing/reading not in the beginning of the EEPROM, but in another address I think something like that will work:
template <typename T>
unsigned int writeAnythingToEEPROM(const T& value, unsigned int addressToStart)
{
const byte * p = (const byte*) &value;
unsigned int i;
for (i = addressToStart; i < (sizeof value) + addressToStart; i++)
{
EEPROM.update(i, *p++);
}
return i;
}
template <typename T>
unsigned int readAnythingFromEEPROM(T& value, unsigned int addressToStart)
{
byte * p = (byte*) &value;
unsigned int i;
for (i = addressToStart; i < (sizeof value) + addressToStart; i++)
{
*p++ = EEPROM.read(i);
}
return i;
}
Notice that the change is in the for loop
But I never had to use this functions like that because when I need to save more than one variable, I make it as an structure and save the whole structure in the EEPROM, so I don't have to thing about the beginning and ending address of each variable in the EEPROM
I think thats it, if you didn't understand something, tell and I can explain better
Edit: you can use the functions
EEPROM.put(0, savednumbers); and EEPROM.get(0, savednumbers);
instead of
writeAnythingFromEEPROM(savednumbers); and readAnythingFromEEPROM(savednumbers);
They make exactly the same thing, but are built in the EEPROM library