// This example reads the byte value at address 28 in EEPROM // memory every second, and sends it over the serial line. // It then cyclically increments that value by one, and // writes it to the same address in EEPROM memory. // After removing the power from the i/o board, this code // picks up where it left off, because values stored in // EEPROM memory retain their value when power is lost. #include // (WIRING) import eeprom functions //#include // (ARDUINO) import eeprom functions byte b; void setup() { Serial.begin(9600); // start serial communication } void loop() { b = EEPROM.read(28); // read byte value from eeprom address 28 Serial.println(b, DEC); // print that value via the serial port b = (b+1) % 256; // cyclically increment the value EEPROM.write(28, b); // write new value to eeprom address 28 delay(1000); // waste one second }