arduino/eeprom/eeprom.ino

29 lines
548 B
C++

#include "lib/AT24Cx/AT24CX.h"
#include "lib/AT24Cx/AT24CX.cpp"
char dataTemplate[] = "Heya!";
AT24C64 eeprom;
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.print("Writing to chip - ");
eeprom.writeChars(200, dataTemplate, sizeof(dataTemplate));
Serial.println("done");
Serial.print("Data: ");
Serial.print(dataTemplate);
Serial.println();
delay(1000);
Serial.print("Data on chip: '");
char data[5];
eeprom.readChars(200, data, sizeof(data));
Serial.print(data);
Serial.println("'");
delay(1000);
}