StoreData \ Learning \ Wiring ALPHA 1.0
Author: Hernando Barragán
Description: Wiring is an electronic sketchbook and hardware electronics for developing ideas. It is a context for learning fundamentals of computer programming and prototyping with electronics within the context of the electronic arts.
Keywords: Wiring, Processing, Interactive Media, Electronic Arts, Programming, C, C++, Hernando Barragán

Search wiring.org.co:

This example is for Wiring version 0023+. If you have a previous version, use the examples included with your software. If you see any errors or have comments, please let us know.

EEPROM store data by BARRAGAN
Demostrates how to store data in the EEPROM

    #include <WEEPROM.h>

    char val;

    void setup() {
      if(EEPROM.read(5) != 'H') {  // If an H hassn't been stored before
        // in the EEPROM address 5
        EEPROM.write(5, 'H');  // store an 'H' in EEPROM address 5
      }
      val = EEPROM.read(5);    // read value stored in EEPROM address 5

        pinMode(48, OUTPUT);
    }

    void loop() {
      if( val == 'H' )  // if val is 'H' then turon ON the onboard LED (pin 48)
      {
        digitalWrite(48, HIGH);
      }
      delay(100);
    }