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

  1. #include "lib/AT24Cx/AT24CX.h"
  2. #include "lib/AT24Cx/AT24CX.cpp"
  3. char dataTemplate[] = "Heya!";
  4. AT24C64 eeprom;
  5. void setup() {
  6. Serial.begin(9600);
  7. }
  8. void loop() {
  9. Serial.print("Writing to chip - ");
  10. eeprom.writeChars(200, dataTemplate, sizeof(dataTemplate));
  11. Serial.println("done");
  12. Serial.print("Data: ");
  13. Serial.print(dataTemplate);
  14. Serial.println();
  15. delay(1000);
  16. Serial.print("Data on chip: '");
  17. char data[5];
  18. eeprom.readChars(200, data, sizeof(data));
  19. Serial.print(data);
  20. Serial.println("'");
  21. delay(1000);
  22. }