Go Down

Topic: Running Arduino after unpowering (Read 601 times) previous topic - next topic

betserd

Hi All,

it seems strange but I can't simply seem to find an answer to the most basic question I think could be asked for the arduino;

I want to run my program on the arduino and after disconnecting the power (and USB) it should just restart the program it had before.
Is this possible or do I need to upload the program via USB all the time again?

thanks,
Bastiaan

Grumpy_Mike

Quote
it should just restart the program it had before.

Yes that is what happens when you plug it in again or apply some external power through the power jack.

Quote
do I need to upload the program via USB all the time again?

No need to upload again, the sketch is in until you over write it with something else.

betserd

Hi Mike,

thanks for that, that is a relief!
Probably something else went wrong when I powered it up again, and led me to some faulty conclusions.

thanks for the answer!
Bastiaan

michinyon

When I want to change some part of the circuit or want to stop the sketch
from running,  I unplug the USB cable from
the Arduino.  I then make the change  and plug the USB cable back in.

Every time I do this,  the computer won't communicate with the arduino any more.

If I unplug the USB cable again,    and then plug it back in,   it always works the
second time.

Is there any reason for this ?  It is creating double the wear and tear on the USB
socket,  and sooner or later something will get broken while I am pulling it in
and out.

Grumpy_Mike

Quote
When I want to change some part of the circuit or want to stop the sketch
from running,  I unplug the USB cable from the Arduino.


This might happen if something on your computer has the serial port open, like the monitor. Always close that down before pulling the plug.

mvsopen

I've never had to unplug anything after changing the code, except for today with a new install of Version 1 when the "avrdude" programmer returned an out-of-sync message. All I do is upload the new code, then hit the reset button to start things running again.

If that doesn't fix it, and you must unplug, then add another short USB extension cable. Leave that one plugged into your Arduino, and disconnect from the longer cord. I use this method frequently on my PC's to avoid damaging their USB ports.

Go Up