How do I go about retrieving the sketch off of the arduino to show the sketch on the compliler? Also how do i go about to clear the current sketch on the arduino?
THank you for you help.
How do I go about retrieving the sketch off of the arduino to show the sketch on the compliler? Also how do i go about to clear the current sketch on the arduino?
THank you for you help.
I'm not sure there is a way to read the sketch on the board after it's uploaded.
And as far as clearing the sketch goes, I believe the best you're going to be able to do would be uploading a sketch with just the minimal:
void setup(){
}
void loop(){
}
it won't do anything.. and it'll be .. it says 436 bytes.
You can read the sketch back using an ISP programmer - you can't do it using the built in USB serial port.
When you did read it back in, it would be in machine code - a .hex file not readable by humans. You can get disassemblers which would transfor the machine code into assembly code, but you'll have to translate that into "arduino-speak" yourself - probably something you wouldn't be able to do if you are asking this question. It would be MUCH faster to re-write the program from scratch.
If you have an ISP programmer you can "erase" the chip. Uploading a blank sketch, as CaptainObvious suggest, is the easist way to do it if you don't have an external programmer, or want to keep the bootloader.