English documentation. Indonesian version: README.id.md
EEPROMHandler is an Arduino-compatible I2C helper library for AT24Cxx external EEPROM chips.
It provides typed save/read/validate helpers for int, long, float, double, char, bool, String, byte arrays, and int arrays.
- Chip configuration is now required before any read/write operation.
- You must choose one configuration method:
setChipType(...)setChipGroup(...)
- If one mode is already selected, the other mode returns
false.
- Tested focus:
AT24C128,AT24C256 - Generic group configuration is available for:
AT24ChipGroup::Large2ByteAddressAT24ChipGroup::Small1ByteAddress(custom capacity setup)
Install from Arduino Library Manager or copy this repository into your Arduino libraries folder:
Documents/Arduino/libraries/EEPROMHandler
#include <Wire.h>
#include "EEPROMHandler.h"
EEPROMHandler eeprom(0x50);
void setup() {
Serial.begin(115200);
Wire.begin();
if (!eeprom.setChipType(AT24ChipType::AT24C256)) {
Serial.println("Chip config failed");
return;
}
eeprom.saveInt(0, 1234);
int value = eeprom.readInt(0);
Serial.println(value);
}
void loop() {}Example for AT24C256 (32 KB, 2-byte word address):
eeprom.setChipGroup(AT24ChipGroup::Large2ByteAddress, 32768);saveInt()/readInt()store 16-bit signed values (2 bytes) for cross-board consistency.saveLong()/readLong()store 32-bit signed values (4 bytes).doubleis stored using the board's nativesizeof(double)(4or8bytes depending on core).Stringstores a 2-byte length header followed by raw characters.- All operations require successful chip configuration first.
- Library compile compatibility is broad (
architectures=*), but behavior depends onWireimplementation and chip/addressing setup. doubledata is not guaranteed cross-board compatible (e.g. AVR vs STM32/ESP) because size may differ.- For portable EEPROM layouts across boards, prefer
int(16-bit stored),long(32-bit stored),float, andbytebuffers.
The examples/ folder is split by difficulty and feature:
01_Basic_SetChipType02_Basic_SetChipGroup03_PrimitiveTypes04_String_And_Bytes05_Array_And_Validation06_AddressMap_Layout07_ChipConfigRequired
EEPROMHandler/
|-- examples/
|-- src/
| |-- EEPROMHandler.h
| `-- EEPROMHandler.cpp
|-- keywords.txt
|-- library.properties
|-- README.md
`-- README.id.md
This project is licensed under GPL-3.0.