/*
* EEPROM Read
*
* Reads the value of each byte of the EEPROM and prints it
* to the computer.
* This example code is in the public domain.
*/
#include <EEPROM.h>
// start reading from the first byte (address 0) of the EEPROM
unsigned int address = 0;
byte value;
void setup()
{
// initialize serial and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
}
void loop()
{
Serial.print("EEPROM Länge: "); Serial.println(EEPROM.length());
// read a byte from the current address of the EEPROM
for (address = 0; address < EEPROM.length(); address+=16) {
char temp[8];
sprintf(temp, "%04d-%04d", address, address+15);
Serial.print(temp);
Serial.print(" ");
char tempEEPROM[16];
for (int i=0;i<=15;i++) {
value = EEPROM.read(address);
tempEEPROM[i] = value;
Serial.print(" ");
Serial.print(value, HEX);
}
Serial.print(" ");
for (int i=0; i<=15;i++) {
if (tempEEPROM[i] < 32 || tempEEPROM[i] > 126) {
Serial.print(".");
} else {
Serial.print((char)tempEEPROM[i]);
}
}
Serial.println(" ");
}
delay(4000);
}