Let's write some values inside the memory and then let's retrieve them after we restart the program.
So first of all, if you want to be able to use EPROM functionality in your code, you have to include
the library.
We include like this.
Again, this is the first library that we import and actually the library is already installed.
So you just need to do include and then break it up from that H so EPROM all uppercase.
That age lowercase.
And this way, you can use it in your program.
Let's remove this.
So here, I'm going to write stuff in the.
OK, don't write in the loop funnel if you want to follow what I'm doing right in the city.
That's very important.
One thing to do is simply do it from DOT.
Right.
OK, you can see it then arrange to.
So from that right, you can simply write a volume inside it from memory, so you have to give two arguments
here.
The first one is the other.
So the other race goes from zero to one thousand twenty three.
OK, you have one thousand twenty four values.
So of course, in programming we start to count at zero.
So the maximum is one thousand twenty three.
So I'm just going to use the algorithm zero and then I can write a bite.
So any value between zero and two hundred fifty five.
So let's say I write forty four.
All right, let's use another EPROM.
Right.
So if you want to write on two addresses like this, you can just write EPROM, right twice.
Let's say what to write on the other.
Two hundred and I want to write one hundred fifty.
So with this good, I'm going to write Disvalue 44 inside the other a zero and Disvalue 150.
Inside the address 200.
And let's actually run that code like this so.
To a prom, right, only in the.
Don't write them in the loop, because if you put that in the loop, it is going to go very, very,
very fast.
And then you are going to write on the address is very fast and reach the one hundred thousand right
cycle and then the other is zero and the address 200 will be gone.
You still have the other ones, but then you are just destroying two addresses here.
We just write ones.
So that's completely fine.
So two bodies.
OK, upload.
EPROM.
OK, Don, applauding so well here you don't have any output.
OK, you don't have anything on sale, you don't have any LCD blinking or whatever.
You don't have anything.
You just have written values in the paper.
OK, what I'm going to do.
I'm going to comment this.
So this will not be executed and I'm going to do so.
Footprint print, Ellen.
EPROM reboot with zero.
So if you want to write a value, you just do it right with the address and the value.
If you want to read a value, it's very simple.
You do it from the tree and then the other is OK and you will get the value that was stored in that.
Otherwise, of course, you sell print and insole.
So they'll begin.
And I'm going to do this.
One or two more times.
OK, I'm going to read from the other.
Let's see.
Eighty nine and the address, two hundred.
And let's see what it does.
So, of course I have this is important commented are removed those two lines and also upload code.
Don't applauding and to say on Moniteau.
And you can see so what do we have here?
Quite interesting, we have 44 which correspond to the address zero and then we have 255 for the address.
Eighty nine and one hundred fifty for the address.
Two hundred he and this program, we don't write to the market, so value 44 that we read from the address.
Zero is here because it was told in April.
OK, I have restarted the program but the value is still here.
OK, so all the variables in the program are gone, but what you have saved in the memory stays there.
We have added value 44 and the other is zero.
We also retrieve the value one hundred fifty and the other is two hundred.
So that's the exact values we have written previously.
And then you can see I just.
But any random address.
Eighty nine and we have the value.
Two hundred fifty five.
So basically if you have not written anything you will get 255 or so, maybe zero.
Depends on if you have read it by yourself, do it from memory with zero before you can see we have
this value.
If you have not written to me from before so great, you have saved your first values inside the memory
and you were able to reach them in another run of the program with a different program actually using
so EPROM write to write and to read.
And now once again, make sure you don't do it from the right in the void loop like this directly in
an infinite loop that goes very fast.
But it doesn't mean that you can't use it from right in the loop.
Only use it with a condition.
OK, we've if condition with something that only happens not frequently.
For example, when you get data from the sale communication or if you want to price the pushbutton,
stuff like this.
So you make sure that you don't write in from memory to often.
All right, and that's pretty much it for the economy.
So, as you can see, that is quite simple to use.