Thursday, May 6, 2010

Task 52 - Writting to EEPROM




The program writes $23(35) to address 01 and $2A(42) to address 02 and displays them to the screen.

#include

int a = 0;
int value;

void setup()
{
Serial.begin(9600);

EEPROM.write(1, 35);
EEPROM.write(2, 42);

}

void loop()
{
value = EEPROM.read(a);

Serial.print(a);
Serial.print("\t");
Serial.print(value);
Serial.println();

a = a + 1;

if (a == 512)
a = 0;

delay(500);
}

No comments:

Post a Comment