A place for all the arduino code I write.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
548 B

#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);
}