As you already know, when you start or restart an out in a program, all the data stored in the valuables
is completely gone.
Every time you start from scratch, it could be useful to store a value.
For example, the setting which replaces the default one.
Let's say you are printing the temperature from the sensor and you offer two options.
Either you can display the temperature in degrees Celsius or in degrees Fahrenheit and you can change
between them by pressing on the push button.
Well, if you can't save the sitting every time we start or restart the program, you will get the same
default setting.
However, if you are able to save it for later, when you restart the program, you can just read what
was the previous setting and apply it directly.
The April memory, solve that issue.
During the execution of the program, you can save different values to the memory.
Those values are stored just like values would be stored on your hard drive for your computer when you
restart your computer.
The run is gone, but not the data on your hard drive.
So when you restart the program, you can read the data previously stored in the EPROM and use it to
do whatever you want.
So the principle is quite easy to understand.
Now, before we actually use EPROM for the first time, there are some limitations you have to know
to correctly use it.
First, not all Arduino boards have a memory.
It's available on Nonno and Maiya, for example, but not on Arduino zero.
Then the storage is super limited on untrainable such as window and nano.
You can only store one thousand twenty four values, each one being about between zero and two hundred
fifty five.
So that's a very small memory on average.
Amiga, it's full time, bigger, but still very small.
And one important thing to always remember on a given address of the EPROM, you only have about one
hundred thousand writing cycles.
You can read Evalu as many times as you want, but when you write to Epuron after 100000 writing operations
on a given address, this address will be kind of weird off and it won't work anymore.
So from all those points, we can make some conclusions.
EPROM with only be useful to store very small values and not too often.
The best example is a default setting you want to override with the previous sitting from the last execution
of your Arduino program.
Don't expect to store things like photos or videos or even text larger than, let's say, two pages.
And then due to the limitation of the writing cycles, never, ever write in your EPROM at full speed
in the void look function of your program or in any other infinite loop that goes very fast, you would
quickly reach the one hundred thousand limit and then the address can't be used anymore.
So test your program before if you are not sure and if you correctly test your program before writing
it from memory, well, you will not have any problem.