Keep Pin States in EEPROM


This is possible with button state sync but keeping states on eeprom and calling back in void setup loop on startup may be useful.

Im working on home automation system with blynk and i want to keep relay state. Because sometimes electricity goes off.

If it is possible, example sketch may be placed in I will try to do this.


this is not really blynk related. the syntax it is a bit mcu dependent. search the official arduino docs and the esp core docs. actually, it is not complicated. but be aware that the eeprom write is a relatively slow porcedure.

1 Like

You can potentially send the value to an unused virtual Pin and sync it back once the power is back on

Yes, this is by far the best method.
Each EEPROM memory location has a limited read/write life. If you keep updating a location with a button state then you’ll “burn it out”. Far better to use Blynk’s free cloud server storage for that :grin:


1 Like

i learned one more thing. Thanks. I am doing this with virtual pin. Just trying to find different solutions.

Answers will help.