Created
February 11, 2018 19:05
-
-
Save HectorTorres/1c4987e64446d0e561039f8aeb870f51 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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