Two different setting in One system

Hi, everyone.
I will do a project that has 2 setting in one Arduino coding system.
The settings are called 'default setting' and 'cycle setting'.

And, as far as I know...
Arduino will reset the system back to its original coding state.

So, can I build two different setting in one Arduino system and make the setting stay although the Arduino has been Off?

*Note that,
this project requires a button to set/change from the 'default setting' to the 'cycle setting'.
And, once the 'cycle setting' is On, it will stay On although the Arduino is off.

Kindly needs supervise from Arduino society...
Thank you.

You could write the current setting to EEPROM whenever it changes, and have the sketch read the EEPROM in setup() each time it fires up.

Hi,

Thanks, manor_royal.
That means I can do the project.
:slight_smile:

Test it first before you commit, though :wink:

Be very careful with the eeprom write, since if you accidentally do it every time through loop() rather than an update, you'll soon hit the 100k write limit and then you're screwed.

Quote from the page I linked:

The EEPROM memory has a specified life of 100,000 write/erase cycles, so using this function instead of write() can save cycles if the written data does not change often

Erm..

maybe you can give me another link that I can try and learn about it.

By the way, thank you for suggesting me to test it before I do deep into the project...
:smiley:

maybe you can give me another link that I can try and learn about it.

The EEPROM.h library, included with the Arduino IDE, has several example programs. Have you looked at them?

What questions do you have?