Hide minor edits - Show changes to markup
Examples > EEPROM Library
Ejemplos > librería EEPROM
Reads the value of each byte of the EEPROM and prints it to the computer.
Lee el valor de cada byte de la EEPROM y lo imprime por el puerto serie.
// start reading from the first byte (address 0) of the EEPROM int address = 0; byte value;
// empieza en el primer byte (dirección 0) de la EEPROM int direccion = 0; byte valor;
// read a byte from the current address of the EEPROM value = EEPROM.read(address);
// Lee un byte de cada direccion de la EEPROM valor = EEPROM.read(direccion);
Serial.print(address);
Serial.print(direccion);
Serial.print(value, DEC);
Serial.print(valor, DEC);
// advance to the next address of the EEPROM address = address + 1;
// incrementa "direccion" en 1 para avanzar a la siguiente dirección de la EEPROM direccion = direccion + 1;
// there are only 512 bytes of EEPROM, from 0 to 511, so if we're
// on address 512, wrap around to address 0
if (address == 512)
address = 0;
// Solamente hay 512 bytes de EEPROM, desde 0 hasta 511
// Si estamos en la direccion 512, volvemos a la dirección 0
if (direccion == 512)
direccion = 0;
@]
Examples > EEPROM Library
Reads the value of each byte of the EEPROM and prints it to the computer.
#include <EEPROM.h>
// start reading from the first byte (address 0) of the EEPROM
int address = 0;
byte value;
void setup()
{
Serial.begin(9600);
}
void loop()
{
// read a byte from the current address of the EEPROM
value = EEPROM.read(address);
Serial.print(address);
Serial.print("\t");
Serial.print(value, DEC);
Serial.println();
// advance to the next address of the EEPROM
address = address + 1;
// there are only 512 bytes of EEPROM, from 0 to 511, so if we're
// on address 512, wrap around to address 0
if (address == 512)
address = 0;
delay(500);
}