Skip to content

Instantly share code, notes, and snippets.

@HectorTorres
Created February 11, 2018 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HectorTorres/1c4987e64446d0e561039f8aeb870f51 to your computer and use it in GitHub Desktop.
Save HectorTorres/1c4987e64446d0e561039f8aeb870f51 to your computer and use it in GitHub Desktop.
/*
FUNCIÓN EEPROM ITERATION
Se itera usando distintos métodos
Este código no funciona por sí solo, pero cada método se puede usar
individualmente en otros programas
*/
#include <EEPROM.h>
void setup()
{
for (int indice = 0; indice < EEPROM.length(); indice++) // Itera usando un ciclo for
{
EEPROM[ indice ] += 1;
}
int indice = 0;
while (indice < EEPROM.length()) // Itera usando un ciclo while
{
EEPROM[ indice ] += 1; // Añade un “1” a cada celda en la EEPROM
indice++;
}
int indic = 0; // Se usa otra variable para evitar conflicto de nombres con "indice"
do
{
EEPROM[ indic ] += 1;
}
while (indic < EEPROM.length());
}
void loop()
{
// void loop vacío
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment