EEPROM Writing and reading

i wanted to add a feature that power resumption last state for my code .Can you please help.

Hi Sathyan (@sat). Welcome to the littleBits forum!

Look at the official Arduino documentation here:

It doesn’t specifically mention the littleBits Arduino module, nor the ATMega 32u4 chip used in it. The 32u4 has 2560 bytes of EEPROM, and works just like the regular Arduino to write to and read from it.

One issue to be aware of, is that EEPROM memory has a lifetime of about 100,000 write cycles. When used to save a state after a setting, this usually isn’t a problem. But, if your program (accidentally?) writes every time through the loop, you can use it up in a second or two, so design your program carefully.

If you are worried about using up the EEPROM too fast, look into using a ring (or circular) buffer to spread the writes over the entire chip. Look here:

Thank you for your reply. let me try…