Monday 14 September 2020

Arduino Memory with EEPROM

 


Add caption

I hope you know about memory in your computer. It is RAM and ROM. Computer can keep the things in memory temporally until the power is off and also it can be kept continuously even after the power is off such as in hard drive.




RAM







ROM




The same thing happens when the Arduino is with EEPROM. You can keep data in memory I the each Digital pin.










Shall we see from SetNFix channel how to write data in arduino and how to read the data as well?


You have to use EEPROM library to keep the things in memory. Coding is as follow.

1st include the library

#include <EEPROM.h>

Data Writing:

Now you have to assign a variable for memory.

Shall we assign “x” as the integer variable for pin 2

 Int x = 0;

Now in the void loop,

EEPROM.write(x, 0);

This means, write number 0 in variable x. Then the number 0 will be stored in pin number 2


Read Data

If you want to read the things in the memory, then you have to write the code,

Int value ;

value = EEPROM.read(x);

This means, read the data in “x” and load it in the variable called “value”

This memory function is more important in Arduino Programming. Watch the following video for more details.



Stay with SetNFix.


 


 

Previous Post
Next Post

post written by:

1 comment:

  1. Soldering pencils are very simple soldering tool that can be used only for simple do-it-yourself projects. The most basic type of soldering iron has no temperature control apart from the cooling effect of the air and any work that the iron may be used with. https://solderingironguide.com/reviews/anbes-soldering-irons

    ReplyDelete