(Solved) possible to extract lost code from arduino to computer?

If you happen to loose your sketch, but have it downloaded to an arduino, is it possible to upload the sketch back to the computer from the arduino?

Also, why is it that if power goes through a resistor then goes to a line that leads to the arduino, the arduino won't pick it up? Is there a way around this?

Q1 : No, you can't get your sketch back because it has been compiled.

Q2 : I have no idea what you are asking. Circuit diagram and a full explanation please.

I do not know how to make a diagram, yet. But I can explain.

The 5volt power travels through a red led, the cathode (short leg of led "ground leg") is connected to a 220 resistor, then the other side of the resistor is not connected to ground, but to a wire that leads back to the arduino pin 4. Pin 4 is set up to recognize if power is turned on, but fails to recognize there is power for some reason.

------------------------edit---------------------------------

Another thing I am curious about, is it possible to attach a speaker wire from a surround sound system to the arduino, so that when the sound is on the arduino will know, by registering the power from the speaker?

Is "5V power" the Arduino power?
If so, how would you expect the Arduino to detect "power off"?

Pin 4 is set up to recognize if power is turned on, but fails to recognize there is power for some reason.

If you configure pin 4 as an output and write a “low” to pin 4, the LED should turn on.

Low is (about) zero-volts and (about) the same signal level as ground. (It’s not a ground connection" and the available current is limited.)

If you modify the Blink LED sketch to work with pin 4 it will work the same as the pin-13 LED except the LED goes off when the output is high and on when the output is low. (You can’t tell the logic is reversed by looking at a blinking LED unless you are blinking the pin-13 LED at the same time and they are alternating oppositely on & off.)

Thomas499:
I do not know how to make a diagram, yet. But I can explain.

Draw a diagram with a pencil and post a photo of the drawing.

Drawings are much more meaningful than a description as it it is very easy to mis-understand a description.

...R

Is "5V power" the Arduino power?
If so, how would you expect the Arduino to detect "power off"?

I was using a very simple experiment. The arduino would first send the power through a button. If the button was pressed, the led would come on and the arduino would register it. This is just a simple experiment that I am doing to learn how to connect electronics not designed as arduino shields to the arduino. All the electronics I have taken apart I can register power with a volt meter, but I have not yet been able to get the arduino to register it because power travels through multiple resistors before it reaches the line leading to the arduino ( I think). If I can figure this out, I'll have a starting point on the logic behind it to move to the really cool experiments.

I have not yet been able to get the arduino to register it because power travels through multiple resistors before it reaches the line leading to the arduino ( I think)

This is not correct. You really need to study up on basic circuits and learn what the term "circuit" actually means.

You need to understand the difference between current and voltage -- they are completely different concepts -- and how resistance can relate the two in a circuit.Google for introductory material on electrical circuits.

Another thing I am curious about, is it possible to attach a speaker wire from a surround sound system to the arduino, so that when the sound is on the arduino will know, by registering the power from the speaker?

This is the third topic in this thread and you should have probably started with a new post under Project Guidence or Audio....

Yes, you can read an audio signal on an analog input. (Don't forget to connect the speaker ground to the Arduino ground.*)

However, the Arduino can be damaged by negative voltages or voltages above +5V. Since audio is AC, it's negative half of the time and a speaker-level signal can go over 5V. A resistor and a pair of "protection diodes" as shown on [u]this page[/u] will protect the Arduino. (If you change the resistor to about 10k you can use this circuit for speaker signals, line-level signals, or headphone signals.)

Just to get started, the [u]Analog Read Serial[/u] sketch can be used to display the readings. When the audio is present the readings should be jumping-around. When there is silence you should read zero (or nearly zero).

  • There are "bridge" amplifiers that don't have a ground, and connecting the "minus" output to ground can damage the amplifier. Bridged amplifiers are somewhat unusual, so you'd probably know if you have one. I've never seen a bridged output on a home theater receiver, so you are probably safe with a "surround system".

This is not correct. You really need to study up on basic circuits and learn what the term “circuit” actually means.

You need to understand the difference between current and voltage – they are completely different concepts – and how resistance can relate the two in a circuit.Google for introductory material on electrical circuits.

I did as you instructed and found the book Getting Started in Electronics by Forrest M. Mims III comes highly recommended, and is available at RadioShack. I am heading that way to pick it up now and will start reading up. I anticipate it will take me 3-6 days to read the entire 128 page book, and to retain what everything in it actually means.

In the meantime, Can you tell me if it’s possible to get the arduino to register the current or whatever, once it passes through a resistor? And if it’s possible for an arduino to register a speaker wire from a surround sound unit has been turned on?

----------------------------edit---------------------------------
My question regarding the speaker system was answered while I was typing this message. Thanks DvDdoug! I will follow your instructions as well, and will start experimenting right away with this new technology. Many thanks!

Can you tell me if it's possible to get the arduino to register the current or whatever, once it passes through a resistor?

current voltage across a resistor.
If you mean can it save the value it reads from an analog input, YES.
The analog inputs on a UNO, for example, can read 0-5 volts.
The readings are in the range of 0-1023 for 0-5 volts.

I anticipate it will take me 3-6 days to read the entire 128 page book, and to retain what everything in it actually means.

Dreamer. 3 to 6 days to read the book is realistic. Expecting to understand and retain everything in that time frame is not.