You should not write to the EEPROM every second. The number of writes is limited if you know. Ideally, if you need to save, you should save only if there is a change in status of the port. This will reduce the number of writes.
This looks like a test program to me. So, please think of your real application. You may not need to update the EEPROM so frequently..
Jerson
Bookmarks