diff options
author | Federico Fissore <f.fissore@arduino.cc> | 2015-07-06 15:18:33 +0200 |
---|---|---|
committer | Federico Fissore <f.fissore@arduino.cc> | 2015-07-06 15:19:05 +0200 |
commit | b5a130afb51c971fd7ceca8834b6055f1eada253 (patch) | |
tree | d1e964f67822e9b3f10382573a9579c85b9c3e3f /libraries/EEPROM/examples/eeprom_iteration | |
parent | c13cf02651e178ea7941a82bee364d82c6b19b9c (diff) |
Examples: mass code format. See example_formatter.conf
Diffstat (limited to 'libraries/EEPROM/examples/eeprom_iteration')
-rw-r--r-- | libraries/EEPROM/examples/eeprom_iteration/eeprom_iteration.ino | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/libraries/EEPROM/examples/eeprom_iteration/eeprom_iteration.ino b/libraries/EEPROM/examples/eeprom_iteration/eeprom_iteration.ino index 650c90a..3673b47 100644 --- a/libraries/EEPROM/examples/eeprom_iteration/eeprom_iteration.ino +++ b/libraries/EEPROM/examples/eeprom_iteration/eeprom_iteration.ino @@ -1,12 +1,12 @@ /*** eeprom_iteration example. - + A set of example snippets highlighting the simplest methods for traversing the EEPROM. - - Running this sketch is not necessary, this is + + Running this sketch is not necessary, this is simply highlighting certain programming methods. - + Written by Christopher Andrews 2015 Released under MIT licence. ***/ @@ -18,40 +18,40 @@ void setup() { /*** Iterate the EEPROM using a for loop. ***/ - - for( int index = 0 ; index < EEPROM.length() ; index++ ){ + + for (int index = 0 ; index < EEPROM.length() ; index++) { //Add one to each cell in the EEPROM EEPROM[ index ] += 1; } - + /*** Iterate the EEPROM using a while loop. ***/ - + int index = 0; - - while( index < EEPROM.length() ){ - + + while (index < EEPROM.length()) { + //Add one to each cell in the EEPROM - EEPROM[ index ] += 1; + EEPROM[ index ] += 1; index++; } - + /*** Iterate the EEPROM using a do-while loop. ***/ - + int idx = 0; //Used 'idx' to avoid name conflict with 'index' above. - - do{ - + + do { + //Add one to each cell in the EEPROM - EEPROM[ idx ] += 1; + EEPROM[ idx ] += 1; idx++; - }while( idx < EEPROM.length() ); - - + } while (idx < EEPROM.length()); + + } //End of setup function. -void loop(){}
\ No newline at end of file +void loop() {}
\ No newline at end of file |