How do you delete saved files?


(Muntin Doo) #1

I’ve played games like glove, squario, arduventure, and other things, and i’ve noticed that even if you install another game, then install that same game that you played before, the game will still say your previous scores. I was just wondering how to delete all the saved files.


"Semi-Official" Game List for the Arduboy
(Scott) #2

Saved game data is stored in EEPROM. You can use the following sketch to erase all of the EEPROM used by sketches. NOTE that this will erase the scores and other data for every sketch that you’ve ever uploaded!

#include <Arduboy2.h>
#include <EEPROM.h>

Arduboy2 arduboy;

void setup() {
  arduboy.begin();
  arduboy.clear();
  arduboy.setCursor(0,0);
  arduboy.println("Erase all EEPROM?\nLEFT + B for YES\nRIGHT for NO\n");
  arduboy.display();
  while (1) {
    if (arduboy.pressed(LEFT_BUTTON + B_BUTTON)) {
      arduboy.println("Erasing EEPROM\nPlease wait...");
      arduboy.display();
      for (int i = EEPROM_STORAGE_SPACE_START; i < 1024; i++) {
        EEPROM.update(i, 0xff);
      }
      arduboy.print("Erase complete.\nUpload a new sketch.");
      arduboy.display();
      break;
    }
    if (arduboy.pressed(RIGHT_BUTTON)) {
      arduboy.print("Erase canceled.");
      arduboy.display();
      break;
    }
    delay(250);
  }
}

void loop() {
}

Help, Erase /Clear Arduboy
[Solved] Do I have to flash it? After reset is not recognized by Windows
Squario: The Ultimate Adventure
(Muntin Doo) #3

Thank you for the code you uploaded.


(Muntin Doo) #4

The code doesn’t seem to work with Arduventure though.


(Scott) #5

Arduventure is using the first 16 bytes of EEPROM. This area has been reserved by the Arduboy library for system use and should not be used by sketches, so my sketch above doesn’t clear it.

@DSSiege11 should modify Arduventure to only use EEPROM above EEPROM_STORAGE_SPACE_START which is defined in the Arduboy library.
Edit: This has now been done.

In the mean time, if you want to clear absolutely all of EEPROM, and thus include the area Arduventure is using, change EEPROM_STORAGE_SPACE_START to 0 in the sketch above.


(Christoph Kleinschmidt) #6

Hello, I need your help.
I can´t delete Arduventure. I tried it, but nothing helps.
What can I do?

Thank You!


(Scott) #7

http://community.arduboy.com/t/how-to-use-flashlight-mode-to-fix-bricked-arduboys/2326/1


(Christoph Kleinschmidt) #8

THANK YOU! YOU SOLVED MY PROBLEM! HAVE A NICE DAY :slight_smile: