Pages: [1]   Go Down
Author Topic: Reset Arduino 2560  (Read 876 times)
0 Members and 1 Guest are viewing this topic.
St. Lucia, West Indies
Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How do I clear the memory on the arduino?
I have a Arduno Mega 2560.

How can I make it Like fresh out off the box.
Logged

Copenhagen, Denmark
Offline Offline
Edison Member
*
Karma: 33
Posts: 1225
Have you testrun your INO file today?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why clear it?

You overwrite an old sketch when you put in a new sketch

If you want to you can put in an sketch that does nothing - just like when you load the example sketch Bare Essentials.

Normally the board is loaded with the blink sketch, so LED 13 blinks when you apply power - as a sort of "Welcome" and verification that board is operational.
Logged

St. Lucia, West Indies
Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thats the thing my LED 13 does not blink.
Logged

Newcastle, England
Offline Offline
Sr. Member
****
Karma: 3
Posts: 489
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you have used the EEPROM, you will need to clear that to 'empty the IC'. Have a look here: http://arduino.cc/en/Tutorial/EEPROMClear.

Onions.
Logged

My website: http://www.harryrabbit.co.uk/electronics/home.html Up and running now! (Feel free to look round!) smiley-grin

St. Lucia, West Indies
Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay I ran the code and my LED 13 only blinks twice when it comes on and doesn't blink again until i press the reset button. Is that normal?
Thanks Onions for your effort.
Logged

Newcastle, England
Offline Offline
Sr. Member
****
Karma: 3
Posts: 489
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you using the normal blink sketch? If you put the digitalWrite bit into setup, it will only run once.

Code:
/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */

void setup() {               
  // initialize the digital pin as an output.
  // Pin 13 has an LED connected on most Arduino boards:
  pinMode(13, OUTPUT);   
}

void loop() {
  digitalWrite(13, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // set the LED off
  delay(1000);              // wait for a second
}

Onions.
Logged

My website: http://www.harryrabbit.co.uk/electronics/home.html Up and running now! (Feel free to look round!) smiley-grin

St. Lucia, West Indies
Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This was the code i used:


/*
 * EEPROM Clear
 *
 * Sets all of the bytes of the EEPROM to 0.
 * This example code is in the public domain.

 */

#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()
{
}



Is the Led 13 blinking twice is that normal. I will run your code and tell you how it goes.
Thanks again Onions
Logged

St. Lucia, West Indies
Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Same Result.
Logged

Newcastle, England
Offline Offline
Sr. Member
****
Karma: 3
Posts: 489
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ahh... The EEPROM clear turns on the LED when it is finished, that is perfectly normal. (And it was the EEPROM code that you uploaded, so it is working properly).
Msquare said:
Quote
Normally the board is loaded with the blink sketch, so LED 13 blinks when you apply power - as a sort of "Welcome" and verification that board is operational.

so you will need to upload the blink code (below) to have it 'box fresh'. Then, you will have an empty EEPROM and the welcome code loaded.

Code:
/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */

void setup() {                
  // initialize the digital pin as an output.
  // Pin 13 has an LED connected on most Arduino boards:
  pinMode(13, OUTPUT);    
}

void loop() {
  digitalWrite(13, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // set the LED off
  delay(1000);              // wait for a second
}

Otherwise, upload the code below that does nothing, and you will have an empty EEPROM and no working code.
Code:
void setup(){}
void loop(){}
Logged

My website: http://www.harryrabbit.co.uk/electronics/home.html Up and running now! (Feel free to look round!) smiley-grin

St. Lucia, West Indies
Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

THANKS ALOT!

Its now blinking like when it came out of the box.

Thanks Onions  smiley-lol
Logged

Pages: [1]   Go Up
Jump to: