{"id":13780870,"url":"https://github.com/thijse/Arduino-EEPROMEx","last_synced_at":"2025-05-11T14:34:15.855Z","repository":{"id":30727784,"uuid":"34284048","full_name":"thijse/Arduino-EEPROMEx","owner":"thijse","description":"Extended EEPROM library for Arduino","archived":false,"fork":false,"pushed_at":"2020-03-22T08:15:48.000Z","size":147,"stargazers_count":171,"open_issues_count":22,"forks_count":54,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-04-06T15:12:52.861Z","etag":null,"topics":["arduino","eeprom","eepromex-library"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thijse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-20T20:18:08.000Z","updated_at":"2025-02-13T20:23:31.000Z","dependencies_parsed_at":"2022-09-05T05:00:51.589Z","dependency_job_id":null,"html_url":"https://github.com/thijse/Arduino-EEPROMEx","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thijse%2FArduino-EEPROMEx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thijse%2FArduino-EEPROMEx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thijse%2FArduino-EEPROMEx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thijse%2FArduino-EEPROMEx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thijse","download_url":"https://codeload.github.com/thijse/Arduino-EEPROMEx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253580218,"owners_count":21930903,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","eeprom","eepromex-library"],"created_at":"2024-08-03T18:01:20.657Z","updated_at":"2025-05-11T14:34:15.546Z","avatar_url":"https://github.com/thijse.png","language":"C++","readme":"# Arduino EEPROMEx library \n[![Build Status](https://travis-ci.org/thijse/Arduino-EEPROMEx.svg?branch=master)](https://travis-ci.org/thijse/Arduino-EEPROMEx)\n[![License: LGPL v21](https://img.shields.io/badge/License-LGPL%20v2.1-blue.svg)](https://img.shields.io/badge/License-LGPL%20v2.1-blue.svg)\n\nThe EEPROMex library is an extension of the standard Arduino EEPROM library. It extends the functionality of the original Arduino EEPROM library with:\n\n* Reading, writing to basic types. This includes  bytes, longs, ints, floats and doubles.\n* Reading, writing to single bits. This helps efficient usage of the limited EEPROM memory.\n* Reading, writing of any data format. This can be for example structs, strings, etc.\n* Reading, writing of arrays of any format. By storing, for example, arrays of structs one can create a database like structure.\n* Update functions. The function similar to write functions, but only update changed bytes. If structures have only changed partly, updating instead of writing can save a lot EEPROM wear and significantly increase speed.\n* Basic memory allocation functionality. This is basically a counter of the first unallocated byte, and helps giving unique addresses to variables.\n* Enabling write limitation: In theory one can burn out a memory cell in a few minutes: a write/erase cycle takes approximately 4 ms, so writing 100.000 times to a single cell takes 6 1/2 min. Limiting the number of writes during the debug phase helps prevent this.\n* Debugging of writing out of memory range.\n\n\nAnd find detailed explanation and samples of the functionality here: \n[http://thijs.elenbaas.net/2012/07/extended-eeprom-library-for-arduino](http://thijs.elenbaas.net/2012/07/extended-eeprom-library-for-arduino)\n\n## Downloading\n\nThis package can be downloaded in different manners \n\n\n- The Arduino Library Manager: [see here how to use it](http://www.arduino.cc/en/guide/libraries#toc3).\n- The PlatformIO Library Manager: [see here how to use it](http://docs.platformio.org/en/latest/ide/arduino.html).\n- By directly loading fetching the Archive from GitHub: \n 1. Go to [https://github.com/thijse/Arduino-EEPROMEx](https://github.com/thijse/Arduino-EEPROMEx)\n 2. Click the DOWNLOAD ZIP button in the panel on the\n 3. Rename the uncompressed folder **Arduino-EEPROMEx-master** to **EEPROMEx**.\n 4. You may need to create the libraries subfolder if its your first library.  \n 5. Place the **EEPROMEx** library folder in your **arduinosketchfolder/libraries/** folder. \n 5. Restart the IDE.\n 6. For more information, [read this extended manual](http://thijs.elenbaas.net/2012/07/installing-an-arduino-library/)\n- If you want to have a package that includes all referenced libraries, use the pre-packaged library\n 1. Download the package as a zipfile [here](https://github.com/thijse/Zipballs/blob/master/EEPROMEx/EEPROMEx.zip?raw=true) or as a tarball [here ](https://github.com/thijse/Zipballs/blob/master/EEPROMEx/EEPROMEx.tar.gz?raw=true).\n 2. Copy the folders inside the **libraries** folder  to you your **arduinosketchfolder/libraries/** folder.\n 3. Restart the IDE.\n 3. For more information, [read this extended manual](http://thijs.elenbaas.net/2012/07/installing-an-arduino-library/)\n\n\n\n### Using different data formats\n\nThe aim of the library is to also support other standard data types: it currently implements writing and reading to int, long, float and double.\n\n### For reading:\n```\nuint8_t read(int address);\nbool readBit(int address, byte bit)\nuint8_t readByte(int address);\nuint16_t readInt(int address);\nuint32_t readLong(int address);\nfloat readFloat(int address);\ndouble readDouble(int address);\n```\n\nWhere address is the starting position in EEPROM, and the return value the value read from EEPROM. \n\n### For writing:\n```\nbool write(int address, uint8_t value);\nbool writeByte(int address, uint8_t value);\nbool writeInt(int address, uint16_t value);\nbool writeLong(int address, uint32_t value);\nbool writeFloat(int address, float value);\nbool writeDouble(int address, double value);\n```\nThe update functions are different from the write functions: they will check per byte if the current value differs and only update the the cell with a different value. This will not only reduce wear, and can also significantly reduce write time.\n\n```\nbool update(int address, uint8_t value);\nbool updateByte(int address, uint8_t value);\nbool updateInt(int address, uint16_t value);\nbool updateLong(int address, uint32_t value);\nbool updateFloat(int address, float value);\nbool updateDouble(int address, double);\n```\n\n### Manipulating Single bits\n\nThe following functions implements reading and writing single bits:\n\n```\nbool readBit(int address, byte bit)\n```\nWhere bit is the write position in the byte, ranging from [0..7], with bit 0 being the right-most.  The return value is the read bit.\n\n```\nbool writeBit(int address, uint8_t bit, bool value)\nbool updateBit(int address, uint8_t bit, bool value)\n```\n\n### Data blocks\n\nUsing the block functions any data can be read, written and updated:\n\n```\nint readBlock(int address, const T\u0026 value)\nint writeBlock(int address, const T\u0026 value)\nint updateBlock(int address, const T\u0026 value)\n```\n\nwhere T is the type of the data to read/write/update. This can be a basic type, but also a more complex type like a struct. The return value gives the number of bytes that have been read, written or updated.\n\nOne can also read/write arrays of data-blocks:\n\n```\nint readBlock(int address, const T[]; value, int items)\nint writeBlock(int address, const T[]; value, int items)\nint updateBlock(int address, const T[]; value, int items)\n```\n\n### Debugging EEPROM applications \n\nIt is easy to burn out a memory cell in few minutes, so during debugging it would be very useful to limit the number of allowed writes. It is easy to put a bracket at the wrong location, and placing an EEPROM write inside of a loop, rather than outside, and introduce extensive writing causing wear.  The following function helps limit the number of writes.\n\n```\nsetMaxAllowedWrites(int allowedWrites);\n```\n\nMore writes than allowed will be refused and result in an error message. You can also set the address range used by the library:\n\n```\nsetMemPool(int base, int memSize);\n```\n\nThe lower value is used by the getAddress function, the upper value is  used for setting the EEPROM size. Writing outside the maximum size will result in an error message. The following EEPROM sizes are predefined\n\nBased on processor:\n```\n*EEPROMSizeATmega168\n*EEPROMSizeATmega328\n*EEPROMSizeATmega1280\n*EEPROMSizeATmega32u4\n*EEPROMSizeAT90USB1286\n*EEPROMSizeMK20DX128\n```\nBased on board:\n```\n*EEPROMSizeUno\n*EEPROMSizeUnoSMD\n*EEPROMSizeLilypad\n*EEPROMSizeDuemilanove\n*EEPROMSizeMega\n*EEPROMSizeDiecimila\n*EEPROMSizeNano\n*EEPROMSizeTeensy2\n*EEPROMSizeLeonardo\n*EEPROMSizeMicro\n*EEPROMSizeYun\n*EEPROMSizeTeensy2pp\n*EEPROMSizeTeensy3\n```\n\n### EEPROM performance\n\nAll of the read/write functions make sure the EEPROM is ready to be accessed. Since this may cause a delay of max 4ms, time-critical  applications should first poll the EEPROM e. g. using the isReady function before attempting any actual I/O:\n\n```\nbool isReady();\n```\n\n## On using and modifying libraries\n\n- [http://www.arduino.cc/en/Main/Libraries](http://www.arduino.cc/en/Main/Libraries)\n- [http://www.arduino.cc/en/Reference/Libraries](http://www.arduino.cc/en/Reference/Libraries) \n\n\n## Copyright\n\nEEPROMEx is provided Copyright © 2013-2017 under LGPL License.\n","funding_links":[],"categories":["Libraries","C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthijse%2FArduino-EEPROMEx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthijse%2FArduino-EEPROMEx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthijse%2FArduino-EEPROMEx/lists"}