Add uOLED-96-G1 C Sample Code.
[frickel.git] / projects / geeknamensschilder_c / hardware / libraries / EEPROM / examples / eeprom_read / eeprom_read.pde
blob2e30708fcb1acb484f18c675f26a3b5d5563cda4
1 /*
2  * EEPROM Read
3  *
4  * Reads the value of each byte of the EEPROM and prints it 
5  * to the computer.
6  */
8 #include <EEPROM.h>
10 // start reading from the first byte (address 0) of the EEPROM
11 int address = 0;
12 byte value;
14 void setup()
16   Serial.begin(9600);
19 void loop()
21   // read a byte from the current address of the EEPROM
22   value = EEPROM.read(address);
23   
24   Serial.print(address);
25   Serial.print("\t");
26   Serial.print(value, DEC);
27   Serial.println();
28   
29   // advance to the next address of the EEPROM
30   address = address + 1;
31   
32   // there are only 512 bytes of EEPROM, from 0 to 511, so if we're
33   // on address 512, wrap around to address 0
34   if (address == 512)
35     address = 0;
36     
37   delay(500);