dj0tt / arduino

Automatically exported from code.google.com/p/arduino
Other
0 stars 0 forks source link

EEPROM library eeprom_clear example lacks pinMode #1054

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The eeprom_clear example uses digitalWrite without first using pinMode.  Here 
is the example.  Before digitalWrite(13, HIGH), pinMode(13, OUTPUT) should be 
used to configure the pin.

#include <EEPROM.h>

void setup()
{
  // write a 0 to all 512 bytes of the EEPROM
  for (int i = 0; i < 512; i++)
    EEPROM.write(i, 0);

  // turn the LED on when we're done
  digitalWrite(13, HIGH);
}

void loop()
{
}

Original issue reported on code.google.com by paul.sto...@gmail.com on 28 Sep 2012 at 9:23

GoogleCodeExporter commented 9 years ago
Might I suggest using 
LED_BUILTIN
instead of 13
Since not all Arduino boards use 13 (Arduino ethernet board uses 9)

Original comment by jaguar3s...@gmail.com on 4 Oct 2012 at 3:25

GoogleCodeExporter commented 9 years ago
Updated the eeprom_clear example, will be included in a future version of the 
IDE

Original comment by s.fitzge...@arduino.cc on 2 Apr 2013 at 8:57

GoogleCodeExporter commented 9 years ago

Original comment by s.fitzge...@arduino.cc on 2 Apr 2013 at 9:00