Arduino Function: EEPROM.EEPROM

Description

Through this operator, you can use the identifier `EEPROM` like an array. EEPROM cells can be read and written with this method.

Syntax

EEPROM[address]

Parameters

address: the location to read/write from, starting from 0 (int)

Returns

 A reference to the EEPROM cell

Examples

#include 

void setup(){

  unsigned char value;

  //Read an EEPROM cell.
  value = EEPROM[ 2 ];

  //Write other EEPROM cell.
  EEPROM[ 1 ] = value;

  //Compare contents
  if( value== EEPROM[ 0 ] ){
    //Do something...
  }
}

void loop(){ /* Empty loop */ }


Based on the reference originally written by Arduino Community,  wiring.org.co and  arduino.cc