aboutsummaryrefslogtreecommitdiff
path: root/libraries/EEPROM/examples/eeprom_clear/eeprom_clear.ino
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/EEPROM/examples/eeprom_clear/eeprom_clear.ino')
-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. **/
+}