aboutsummaryrefslogtreecommitdiff
path: root/libraries/EEPROM/examples/eeprom_clear
diff options
context:
space:
mode:
authorFederico Fissore <f.fissore@arduino.cc>2015-07-06 15:18:33 +0200
committerFederico Fissore <f.fissore@arduino.cc>2015-07-06 15:19:05 +0200
commitb5a130afb51c971fd7ceca8834b6055f1eada253 (patch)
treed1e964f67822e9b3f10382573a9579c85b9c3e3f /libraries/EEPROM/examples/eeprom_clear
parentc13cf02651e178ea7941a82bee364d82c6b19b9c (diff)
Examples: mass code format. See example_formatter.conf
Diffstat (limited to 'libraries/EEPROM/examples/eeprom_clear')
-rw-r--r--libraries/EEPROM/examples/eeprom_clear/eeprom_clear.ino20
1 files changed, 11 insertions, 9 deletions
diff --git a/libraries/EEPROM/examples/eeprom_clear/eeprom_clear.ino b/libraries/EEPROM/examples/eeprom_clear/eeprom_clear.ino
index 49eb5fe..73d64a7 100644
--- a/libraries/EEPROM/examples/eeprom_clear/eeprom_clear.ino
+++ b/libraries/EEPROM/examples/eeprom_clear/eeprom_clear.ino
@@ -10,26 +10,28 @@
#include <EEPROM.h>
-void setup()
-{
+void setup() {
/***
- Iterate through each byte of the EEPROM storage.
-
+ Iterate through each byte of the EEPROM storage.
+
Larger AVR processors have larger EEPROM sizes, E.g:
- Arduno Duemilanove: 512b EEPROM storage.
- Arduino Uno: 1kb EEPROM storage.
- Arduino Mega: 4kb EEPROM storage.
-
+
Rather than hard-coding the length, you should use the pre-provided length function.
- This will make your code portable to all AVR processors.
+ This will make your code portable to all AVR processors.
***/
-
- for ( int i = 0 ; i < EEPROM.length() ; i++ )
+
+ for (int i = 0 ; i < EEPROM.length() ; i++) {
EEPROM.write(i, 0);
+ }
// turn the LED on when we're done
digitalWrite(13, HIGH);
}
-void loop(){ /** Empty loop. **/ }
+void loop() {
+ /** Empty loop. **/
+}