This example toggles a led on the Simplecortex with the reset button. The program starts with reading the EEPROM. If the value is 0, the program inverts it to 255 and otherwise the same way. Then the new value will be written to the EEPROM and the LED.
int main (void)
/*Initialize EEPROM on I2C channel 1 and select memory block 0*/
/*Set on-board led 1,18 as output*/
/*Read EEPROM and put value in var*/
var = EEPROMRead(I2C1,0);
var = ~var;
/*Copy value to EEPROM and change port status*/