WEBVTT

00:00.180 --> 00:07.810
Let's write some values inside the memory and then let's retrieve them after we restart the program.

00:08.040 --> 00:13.890
So first of all, if you want to be able to use EPROM functionality in your code, you have to include

00:14.010 --> 00:15.740
the library.

00:16.350 --> 00:18.450
We include like this.

00:19.260 --> 00:25.190
Again, this is the first library that we import and actually the library is already installed.

00:25.200 --> 00:33.100
So you just need to do include and then break it up from that H so EPROM all uppercase.

00:33.660 --> 00:35.310
That age lowercase.

00:36.390 --> 00:39.870
And this way, you can use it in your program.

00:40.740 --> 00:41.850
Let's remove this.

00:44.850 --> 00:47.280
So here, I'm going to write stuff in the.

00:47.700 --> 00:52.730
OK, don't write in the loop funnel if you want to follow what I'm doing right in the city.

00:52.900 --> 00:53.910
That's very important.

00:54.600 --> 00:57.580
One thing to do is simply do it from DOT.

00:58.050 --> 00:58.640
Right.

00:59.400 --> 01:02.100
OK, you can see it then arrange to.

01:03.150 --> 01:10.950
So from that right, you can simply write a volume inside it from memory, so you have to give two arguments

01:10.950 --> 01:11.150
here.

01:11.370 --> 01:13.740
The first one is the other.

01:14.380 --> 01:20.090
So the other race goes from zero to one thousand twenty three.

01:20.220 --> 01:23.270
OK, you have one thousand twenty four values.

01:23.760 --> 01:27.620
So of course, in programming we start to count at zero.

01:27.630 --> 01:30.370
So the maximum is one thousand twenty three.

01:31.020 --> 01:36.800
So I'm just going to use the algorithm zero and then I can write a bite.

01:37.020 --> 01:40.870
So any value between zero and two hundred fifty five.

01:41.310 --> 01:43.740
So let's say I write forty four.

01:44.820 --> 01:48.240
All right, let's use another EPROM.

01:49.200 --> 01:49.480
Right.

01:49.500 --> 01:54.860
So if you want to write on two addresses like this, you can just write EPROM, right twice.

01:55.560 --> 01:57.360
Let's say what to write on the other.

01:57.600 --> 02:01.890
Two hundred and I want to write one hundred fifty.

02:02.640 --> 02:10.410
So with this good, I'm going to write Disvalue 44 inside the other a zero and Disvalue 150.

02:10.410 --> 02:11.830
Inside the address 200.

02:12.810 --> 02:16.230
And let's actually run that code like this so.

02:17.260 --> 02:19.480
To a prom, right, only in the.

02:20.020 --> 02:25.480
Don't write them in the loop, because if you put that in the loop, it is going to go very, very,

02:25.480 --> 02:26.170
very fast.

02:26.620 --> 02:33.520
And then you are going to write on the address is very fast and reach the one hundred thousand right

02:33.520 --> 02:38.360
cycle and then the other is zero and the address 200 will be gone.

02:38.530 --> 02:43.050
You still have the other ones, but then you are just destroying two addresses here.

02:43.060 --> 02:44.250
We just write ones.

02:44.260 --> 02:45.710
So that's completely fine.

02:46.600 --> 02:48.000
So two bodies.

02:48.010 --> 02:49.450
OK, upload.

02:51.100 --> 02:51.780
EPROM.

02:54.810 --> 02:58.960
OK, Don, applauding so well here you don't have any output.

02:59.040 --> 03:03.530
OK, you don't have anything on sale, you don't have any LCD blinking or whatever.

03:03.930 --> 03:05.280
You don't have anything.

03:05.370 --> 03:07.950
You just have written values in the paper.

03:08.220 --> 03:10.110
OK, what I'm going to do.

03:10.140 --> 03:11.790
I'm going to comment this.

03:13.190 --> 03:17.270
So this will not be executed and I'm going to do so.

03:19.250 --> 03:20.360
Footprint print, Ellen.

03:21.360 --> 03:25.120
EPROM reboot with zero.

03:26.130 --> 03:31.820
So if you want to write a value, you just do it right with the address and the value.

03:32.100 --> 03:34.530
If you want to read a value, it's very simple.

03:34.540 --> 03:40.740
You do it from the tree and then the other is OK and you will get the value that was stored in that.

03:40.750 --> 03:44.640
Otherwise, of course, you sell print and insole.

03:45.900 --> 03:47.280
So they'll begin.

03:50.650 --> 03:52.420
And I'm going to do this.

03:54.780 --> 03:56.680
One or two more times.

03:56.700 --> 03:58.960
OK, I'm going to read from the other.

03:59.430 --> 04:00.570
Let's see.

04:01.090 --> 04:04.550
Eighty nine and the address, two hundred.

04:05.130 --> 04:06.760
And let's see what it does.

04:06.810 --> 04:13.320
So, of course I have this is important commented are removed those two lines and also upload code.

04:15.540 --> 04:18.780
Don't applauding and to say on Moniteau.

04:21.680 --> 04:24.370
And you can see so what do we have here?

04:24.710 --> 04:33.060
Quite interesting, we have 44 which correspond to the address zero and then we have 255 for the address.

04:33.080 --> 04:36.350
Eighty nine and one hundred fifty for the address.

04:36.560 --> 04:45.380
Two hundred he and this program, we don't write to the market, so value 44 that we read from the address.

04:45.410 --> 04:48.340
Zero is here because it was told in April.

04:48.560 --> 04:53.030
OK, I have restarted the program but the value is still here.

04:53.570 --> 05:00.410
OK, so all the variables in the program are gone, but what you have saved in the memory stays there.

05:01.000 --> 05:03.630
We have added value 44 and the other is zero.

05:04.070 --> 05:08.350
We also retrieve the value one hundred fifty and the other is two hundred.

05:08.450 --> 05:11.350
So that's the exact values we have written previously.

05:12.050 --> 05:13.940
And then you can see I just.

05:13.940 --> 05:15.970
But any random address.

05:15.980 --> 05:18.000
Eighty nine and we have the value.

05:18.020 --> 05:19.370
Two hundred fifty five.

05:19.850 --> 05:26.350
So basically if you have not written anything you will get 255 or so, maybe zero.

05:26.540 --> 05:32.390
Depends on if you have read it by yourself, do it from memory with zero before you can see we have

05:32.390 --> 05:33.050
this value.

05:33.050 --> 05:40.010
If you have not written to me from before so great, you have saved your first values inside the memory

05:40.250 --> 05:47.810
and you were able to reach them in another run of the program with a different program actually using

05:47.810 --> 05:51.050
so EPROM write to write and to read.

05:51.170 --> 05:57.620
And now once again, make sure you don't do it from the right in the void loop like this directly in

05:57.620 --> 05:59.930
an infinite loop that goes very fast.

06:00.620 --> 06:04.110
But it doesn't mean that you can't use it from right in the loop.

06:04.250 --> 06:06.810
Only use it with a condition.

06:06.840 --> 06:12.080
OK, we've if condition with something that only happens not frequently.

06:12.080 --> 06:18.860
For example, when you get data from the sale communication or if you want to price the pushbutton,

06:19.980 --> 06:20.840
stuff like this.

06:21.260 --> 06:24.950
So you make sure that you don't write in from memory to often.

06:26.740 --> 06:28.880
All right, and that's pretty much it for the economy.

06:29.070 --> 06:31.840
So, as you can see, that is quite simple to use.
