WEBVTT

00:00.150 --> 00:06.930
As you already know, when you start or restart an out in a program, all the data stored in the valuables

00:07.110 --> 00:08.470
is completely gone.

00:08.850 --> 00:13.560
Every time you start from scratch, it could be useful to store a value.

00:13.560 --> 00:17.570
For example, the setting which replaces the default one.

00:18.060 --> 00:22.950
Let's say you are printing the temperature from the sensor and you offer two options.

00:23.220 --> 00:30.540
Either you can display the temperature in degrees Celsius or in degrees Fahrenheit and you can change

00:30.540 --> 00:32.940
between them by pressing on the push button.

00:33.390 --> 00:40.020
Well, if you can't save the sitting every time we start or restart the program, you will get the same

00:40.020 --> 00:40.950
default setting.

00:41.310 --> 00:47.880
However, if you are able to save it for later, when you restart the program, you can just read what

00:47.880 --> 00:51.020
was the previous setting and apply it directly.

00:51.390 --> 00:54.150
The April memory, solve that issue.

00:54.630 --> 00:59.840
During the execution of the program, you can save different values to the memory.

01:00.330 --> 01:07.620
Those values are stored just like values would be stored on your hard drive for your computer when you

01:07.620 --> 01:09.010
restart your computer.

01:09.330 --> 01:13.050
The run is gone, but not the data on your hard drive.

01:13.770 --> 01:19.980
So when you restart the program, you can read the data previously stored in the EPROM and use it to

01:19.980 --> 01:21.190
do whatever you want.

01:21.720 --> 01:24.520
So the principle is quite easy to understand.

01:25.060 --> 01:31.240
Now, before we actually use EPROM for the first time, there are some limitations you have to know

01:31.260 --> 01:32.500
to correctly use it.

01:33.090 --> 01:37.050
First, not all Arduino boards have a memory.

01:37.470 --> 01:44.040
It's available on Nonno and Maiya, for example, but not on Arduino zero.

01:44.970 --> 01:51.330
Then the storage is super limited on untrainable such as window and nano.

01:51.630 --> 01:59.220
You can only store one thousand twenty four values, each one being about between zero and two hundred

01:59.520 --> 02:00.260
fifty five.

02:00.690 --> 02:04.140
So that's a very small memory on average.

02:04.150 --> 02:07.890
Amiga, it's full time, bigger, but still very small.

02:08.670 --> 02:15.780
And one important thing to always remember on a given address of the EPROM, you only have about one

02:15.780 --> 02:18.060
hundred thousand writing cycles.

02:18.630 --> 02:26.940
You can read Evalu as many times as you want, but when you write to Epuron after 100000 writing operations

02:26.940 --> 02:34.180
on a given address, this address will be kind of weird off and it won't work anymore.

02:34.980 --> 02:38.850
So from all those points, we can make some conclusions.

02:39.510 --> 02:44.480
EPROM with only be useful to store very small values and not too often.

02:44.970 --> 02:51.780
The best example is a default setting you want to override with the previous sitting from the last execution

02:51.780 --> 02:53.000
of your Arduino program.

02:53.640 --> 03:00.990
Don't expect to store things like photos or videos or even text larger than, let's say, two pages.

03:01.440 --> 03:08.850
And then due to the limitation of the writing cycles, never, ever write in your EPROM at full speed

03:09.060 --> 03:15.960
in the void look function of your program or in any other infinite loop that goes very fast, you would

03:15.960 --> 03:21.170
quickly reach the one hundred thousand limit and then the address can't be used anymore.

03:21.750 --> 03:28.680
So test your program before if you are not sure and if you correctly test your program before writing

03:29.010 --> 03:31.980
it from memory, well, you will not have any problem.
