EEPROM can be used to store non volatile data of the program , sometimes you need to write arrays even multidimensional. The way I do it is by using EEMEM attribute. EMMEM is used to allocate space in EEPROM.
I use the Macros given below to write or read to EEPROM. you have to use #include
#include ////////////////////////////////////////////////////////////////////////// // Macros and # Defines //write block to EEPROM #define eepw(message,EEADDR,BLKSIZE) eeprom_write_block((const void*)message,(void*)EEADDR,BLKSIZE); //read block from EEPROM #define eepr(readblck,EEADDR,BLKSIZE) eeprom_read_block((void*)readblck,(const void*)EEADDR,BLKSIZE); uint8_t EEMEM eepstring[15];
Example use
eepw("sample test 1",eestring, 15); // "writes sample test1" to eestring in EEprom , char d[15]; //array in ram eeprom_read(d, eestring[0],15); // reads the data and puts it in d[]