aboutsummaryrefslogtreecommitdiff
path: root/libraries/EEPROM/examples
diff options
context:
space:
mode:
authorChris--A <chris@genx.biz>2015-03-19 17:13:32 +1000
committerChris--A <chris@genx.biz>2015-03-19 17:13:32 +1000
commitfd4323f360885725c736c90745ee57dbca20e8a0 (patch)
tree34b56149fb0c46a4b59366fab0fd1600dd755da8 /libraries/EEPROM/examples
parentc9ec4eabdab373c756a624f42660acaf0ec6812d (diff)
Small tweaks to EEPROM lib and examples.
Diffstat (limited to 'libraries/EEPROM/examples')
-rw-r--r--libraries/EEPROM/examples/eeprom_iteration/eeprom_iteration.ino8
-rw-r--r--libraries/EEPROM/examples/eeprom_pointer/eeprom_pointer.ino2
2 files changed, 5 insertions, 5 deletions
diff --git a/libraries/EEPROM/examples/eeprom_iteration/eeprom_iteration.ino b/libraries/EEPROM/examples/eeprom_iteration/eeprom_iteration.ino
index 34071fc..a2d825c 100644
--- a/libraries/EEPROM/examples/eeprom_iteration/eeprom_iteration.ino
+++ b/libraries/EEPROM/examples/eeprom_iteration/eeprom_iteration.ino
@@ -42,14 +42,14 @@ void setup() {
Iterate the EEPROM using a do-while loop.
***/
- int idx = 0;
+ int idx = 0; //Used 'idx' to avoid name conflict with 'index' above.
do{
//Add one to each cell in the EEPROM
- EEPROM[ index ] += 1;
- index++;
- }while( index < EEPROM.length() );
+ EEPROM[ idx ] += 1;
+ idx++;
+ }while( idx < EEPROM.length() );
/***
Iterate the EEPROM using a C++11 ranged for loop.
diff --git a/libraries/EEPROM/examples/eeprom_pointer/eeprom_pointer.ino b/libraries/EEPROM/examples/eeprom_pointer/eeprom_pointer.ino
index b56b681..637cdb7 100644
--- a/libraries/EEPROM/examples/eeprom_pointer/eeprom_pointer.ino
+++ b/libraries/EEPROM/examples/eeprom_pointer/eeprom_pointer.ino
@@ -54,7 +54,7 @@ void setup() {
of the C++11 ranged for loop.
***/
- for( EEPtr ptr = EEPROM.begin() ; item != EEPROM.end() ; ++item ){
+ for( EEPtr ptr = EEPROM.begin() ; ptr != EEPROM.end() ; ++ptr ){
Serial.print( *ptr, HEX );
Serial.print( ", " );
}