#include /** the current address in the EEPROM (i.e. which byte we're going to write to next) **/ int address = 0; int val=0; void setup() { /** EMpty setup **/ } void loop() { /*** Update the particular EEPROM cell. these values will remain there when the board is turned off. ***/ EEPROM.update(address, val); val+=1; /*** The function EEPROM.update(address, val) is equivalent to the following: if( EEPROM.read(address) != val ){ EEPROM.write(address, val); } ***/ /*** Advance to the next address, when at the end restart at the beginning. Larger AVR processors have larger EEPROM sizes, E.g: - Arduno Duemilanove: 512b EEPROM storage. - Arduino Uno: 1kb EEPROM storage. - Arduino Mega: 4kb EEPROM storage. Rather than hard-coding the length, you should use the pre-provided length function. This will make your code portable to all AVR processors. ***/ address = address + 1; if (address == EEPROM.length()) { address = 0; } delay(300); }