Remove a sketch from ATmega328

Is It possible to remove a sketch from an Arduino with a 328 using the Arduino IDE?
I have deleted the sketch from my PC.
The program is running now but no more sketch in the Arduino files.
Or is rewriting it the only way?   

sort by: active | newest | oldest

No controller should ever get hooked to Input and Output devices unless it is cleared of logic or has a known program that matches the hardware. Arduino is pretty much a toy but get good safety habits now. Full size robots or control systems can be dangerous.

bwrussell5 years ago
Just rewrite with a blank sketch. Is there a reason you need to do this?

I believe a blank sketch would be:
void setup()
void loop()
WWC (author)  bwrussell5 years ago
Maybe i wrote the question not as clear as i could.
I have a LM35 thermometer sketch with LCD readout running now on my Arduino, but i deleted the program from my computer.
I was asking if it is possible to read the program on the chip and put it back into the Arduino IDE.

Kind of a reverse programming or if the only way is to re write the sketch again.
maewert WWC5 years ago
No way to get back the original sketch. The Arduino contains the compiled image only so you could at most get back Atmega assembly language.

WWC (author)  maewert5 years ago
So my lesson here is be more careful when saving sketches.

bwrussell WWC5 years ago
Yep, learn from your mistakes and keep a backup in the future.
I believe you can acutally save the .hex file to your computer, using a programmer (e.g using an AVRISP MKII and Avr Studio)

However the resulting file will not be editable, at least not through the arduino software/language itself
WWC (author)  astroboy9075 years ago
That is getting beyond my skills at this time.
I have already re written it again.
Good for me anyway i need the practice.