Basic question

I'm new to Arduino, and wonder if it is possible to "read" the sketch that is in an Arduino Uno R3?
My first program worked fine until the Arduino and accessories were finally packaged, but now there appears to be some other program running in it.
Attempts to put my known, good sketch in the Uno don't change it. However, the "blink" sketch does load and run fine.
I'd like to see if the sketch in the R3 is the same as my "good" sketch. Is that possible?
Thanks!
John

If you can load Blink, the uploading process is fine.

It's more likely you have a bug, or a software/hardware issue.

It may help to blink an LED in your bigger code, too, as a heartbeat indicator. And it's probably time for some Serial.println() debugging.

-br

jwax:
Attempts to put my known, good sketch in the Uno don't change it. However, the "blink" sketch does load and run fine.

Once you've loaded "blink" the other sketch is gone. It doesn't hold more than one at a time.

Thanks guys. I'm guessing the answer is "no", for being able to somehow determine what sketch is loaded in the R3.
If I could see the code that is in my Arduino, I could fix it.
I'll have to recreate my code and try uploading that.
Thanks!

The answer is not "no"

The only way that you can not know what is in your Arduino is to load a sketch into it and then delete that sketch from your PC. It sound like that is what you have done. You will probably only do that once. Other than that, the sketch in the Arduino is the sketch you put in it. If there is something wrong with it, you can't fix it in the Arduino but you can fix it in the PC and reload it.

I'll have to recreate my code and try uploading that.

The "sketch" does not exist in your Arduino, the code loaded into your Arduino ids the result of compiling your sketch and loading the created object code (that's what a .hex file is) into the Arduino. The only way you could look at that code in the Arduino would be to dissassemble it and then it would be an assembly language listing and would take a lot of knowledge of how the C compiler works.

If the code worked before hooking up all the hardware, then you have something that you are assuming is happening outside the Arduino board and it isn't, or there is something you assume is not happening outside the Arduino board, and it is. Looks like you need to add some serial prints and figure out where it is spending all its time.

jwax:
Thanks guys. I'm guessing the answer is "no", for being able to somehow determine what sketch is loaded in the R3.

You could download the compiled code from your Arduino (effectively the hex machine code). It can be disassembled back into assembler. You could compare that to the output from compiling your sketch. If they are identical you know what sketch is in the device. But there is no way of getting the C "source" code back.