Encoder read

This example is for Wiring version 1.0 build 0100+. 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 <EEPROM.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(WLED, OUTPUT); 
} 

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