Write relays status with Particle module EEPROM

We have asked this question to the Particle help team:
“I have noticed that the single channel particle relay boards hold their last state in the event of a power cut , but the 2 channel boards do not they go to off position ,is there any way we can retain the last state so the relays return to the last state on a power cycle. We are using the particle photon boards with your 2 channel rely boards”

The answer was:
“If power is disconnected from the controller the relay will loose power and shut off.
However the 1 channel controller IC draws such low current that the on board capacitors actually keep it powered up for a short period of time. After a while though the capacitors will discharge completely and the status of the relay will not be maintained after power is applied again.
For what you are describing you should use the Particle module EEPROM to store the status of the relays in memory, then on boot up read that status from memory and set the relay to the according read state. Particle has documentation on how to use EEPROM here: https://docs.particle.io/reference/firmware/photon/#eeprom

We are not developers and need some help to put together the code examples used in the EEPROM docs to save the relays status on power outage and re-apply them when power is back. Can someone help by providing the right code which we need to add in the firmware?
many Thanks
Matt

Hey there @koy2005 – do you have any questions about implementing? Without knowing more about the firmware you’re developing, it’s hard to simply provide the code to you without additional context. Would you be willing to share your firmware here?