Saturday, September 23, 2017

Modified EEPROM library for Arduino

by / Thursday, 07 April 2011 / Published in Arduino

Very often we encounter such situations when we need to save something in EEPROM. Arduino offers functions to save\read only byte values. But what if we need to store another data types, integer for instance? Sure, we need to create a simple function that will store two bytes of integer.

But wouldn't it be more loigical to have these functions integrated to EEPROM library? Thinking like that, I've modified it, and now I'm sharing my results.

 

For now, there are 4 functions in the library:

  • byte EEPROM.read(int address);
  • int  EEPROM.readInt(int address);
  • void EEPROM.write(int address, byte value);
  • void EEPROM.writeInt(int address, int value);

More functions may be added in future.

Note: when saving\reading integer value, specify the first byte. Second byte (address+1) will also be occupied - automatically.

Download the modified library (v. 001) and replace the existing one with files from zip archive.

2015-04-02 UPDATE: Warning: this library was forked from 2011 one, from Arduino 0022. Arduino 1.0+ chanhed some C++ header files, so you will have to do that as well if you download this legacy version.
Read 1033 times Last modified on Thursday, 02 April 2015 17:24

Do you like this? Please share!

Simon Tushev

Simon is IT professional with interests in web design, electronics, photography and astronomy. He writes about PHP, Yii, Joomla!, Arduino and several other topics.

Welcome!

Here I publish articles related to my areas of interest, my brief notes that may save some time to others, as well as some of my works.

This site is a work in progress. I will add more sections in the future, such as

  • More photos to photogallery
  • More Joomla!-related articles
  • ...

 

themeforest

New Posts

Using dynamic GeoIP module with nginx (CentOS)

nginx introduced dynamic module support in v. 1.9.11. This brief article provides step-by-step procedure...

13-04-2016 in Linux, BSD, Unix

READ MORE

Visual difference between pseudo and true random data

This is is "random" image generated using PHP rand() function: And this is an image...

20-11-2015 in Blog

READ MORE

Best EEPROM practices

(this article is a work in progress). My own advice will be added later...   Having...

12-10-2015 in Arduino

READ MORE
Scroll to top

We use cookies, just to track visits to our website, we store no personal details Privacy policy