O'Reilly logo

Arduino Sketches: Tools and Techniques for Programming Wizardry by James A. Langbridge

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER6

EEPROM

This chapter discusses the read() and write() functions of the EEPROM library. The hardware needed to run the examples in this chapter are an Arduino Uno and a USB cable.

You can find the code downloads for this chapter at http://www.wiley.com/go/arduinosketches on the Download Code tab. The code is in the Chapter 6 download and the filename is chapter6.ino.

Introducing EEPROM

Life would be boring if you had to reinstall software every time you turned off your computer. In the beginning, that is almost exactly what happened. A computer was turned on, and if a floppy disk was not inserted, the computer did not know what to do and just waited. It had no idea of who used it or what programs were available. Ironically, little has changed; instead of a floppy disk, we have hard drives, storing many times more data, but it still relies on the same principle.

Computers typically have two types of memory: volatile and nonvolatile. Volatile memory contains data as long as it is powered. When the power is removed, all the data is lost. This is how RAM works on your home computer. It uses a memory module called DDR. Actually; DDR memory is even more volatile than you might at first think; it needs to be refreshed frequently to keep the data in place. This might sound like poor engineering, but the truth is that Dynamic RAM (DRAM) is extremely fast, dense, and relatively cheap, allowing for inexpensive memory chips that work very well.

Volatile memory is used to store variables ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required