I overwrote the default sketch on my Rev 4 wifi. I have a second one. Can I read the default sketch on the second Uno Rev 4 and save it. Secondly, can I write to the first one.
Essentially, can I clone the second one to the first one?
Thank you, Bob. Is it still safe to assume, one can read the sketch off the board into the arduino IDE? Suppose I have forgotten what the last sketch I save to it does?
It depend on controller settings, the code could be locked.
But even it available, the code that can read from the device has nothing common with sourcecode in the IDE. There are no sketches in the device, it is a compiled binary code firmware. It is impossible to turn binary code back into an Arduino sketch.
No. That is not possible. The sketch gets compiled into machine language and that is what is loaded to the board. The code you wrote in the IDE does not exist on the board.
It is possible to recover the hex file from the board in many situations. I don't know specifically about the Renesas chip on the R4, but for most chips it is possible. But this will not be in any way recognizable as the code you started with. It will just be a bunch of hex values.
It is possible to decompile that hex code and get some code that would produce the same thing. But again, what comes out will not be in any way recognizable as what you started with. And it wouldn't be nice to try to read and figure out.