Go Down

Topic: EEPROM Clear Error Compiling (Read 1 time) previous topic - next topic

WahyuWisuddhi

Jan 29, 2017, 02:55 pm Last Edit: Jan 29, 2017, 03:07 pm by WahyuWisuddhi Reason: wrong attachment
Hello all

I've learned Arduino and I was interested in trying to make RFID access control project is currently trying to get a clear eeprom expamle from libraries i have compiling problem Can someone help how the solution
Code: [Select]
[//*
 * EEPROM Clear
 *
 * Sets all of the bytes of the EEPROM to 0.
 * Please see eeprom_iteration for a more in depth
 * look at how to traverse the EEPROM.
 *
 * This example code is in the public domain.
 */

#include <EEPROM.h>

void setup() {
  // initialize the LED pin as an output.
  pinMode(13, OUTPUT);
 
  /***
    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.
  ***/

  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. **/
}
Using library EEPROM at version 2.0 in folder: C:\Program Files\Arduino\hardware\arduino\avr\libraries\EEPROM
exit status 1
Error compiling for board Arduino/Genuino Uno.]

PaulS

Does your code actually start with
Code: [Select]
[//*
 * EEPROM Clear
 *

?

I deleted the first two characters, and I get:
Quote
Sketch uses 906 bytes (2%) of program storage space. Maximum is 30,720 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2,039 bytes for local variables. Maximum is 2,048 bytes.
The art of getting good answers lies in asking good questions.

Go Up