Should i somehow "reset" my Arduino when moving it from one project to another?

Hi all. I have been wondering, would it be somehow a good idea or best practice to somehow reset my Arduino every time i move it from one project to another one? Point being, that for one project the Arduino might be outputting stuff on various pins, and this might lead to all sorts of trouble when electronic components of a new project are connected, and the Arduino starts running the old program?

Would it be a good habit to run

setup() {}
loop() {}

before connecting new components? Or am i being too careful? :roll_eyes:

That is a good habit, as you note having pins set to outputs while connecting up new hardware could be fatal to the chip.

mace:
Hi all. I have been wondering, would it be somehow a good idea or best practice to somehow reset my Arduino every time i move it from one project to another one? Point being, that for one project the Arduino might be outputting stuff on various pins, and this might lead to all sorts of trouble when electronic components of a new project are connected, and the Arduino starts running the old program?

Would it be a good habit to run

setup() {}

loop() {}




before connecting new components? Or am i being too careful? :roll_eyes:

No it's a good idea, especially if you have a herd of arduino boards that you tend to grap one and try out something quick and dirty. If the arduino has some prior sketch in it that uses I/O pins then bad things can happen if you wire it up to new external circuitry and just power up before loading a new proper sketch into it.

What I do rather then when finished with a project is to just load the blink sketch so that the next time I power up the board I will know that it is using only pin 13 and most likely is running the example blink sketch.

Lefty

Good question, and one I have considered but never bothered doing.

I responded here just simply so I get the thread activity in my "replies".... sorry I've got nothing to add!

Seems like a good idea, yes, both for the Arduino and the attached components.

Thanks for the input folks!

JimboZA:
I responded here just simply so I get the thread activity in my "replies".... sorry I've got nothing to add!

Click the "Notify" button under the thread to be notified of replies. You don't have to reply just to see other replies.

Click the "Notify" button under the thread to be notified of replies.

I know but as far as I could make out when I tested that a month or two back, that notifies by email. I don't want emails, I want to see it in "replies" here in the Forum. Or did I get that wrong? (But I'll double check with an arbitrary thread.)

replies.JPG

Oh, I thought you meant that. Yes that sends an email.

That is a very good idea mace. Thanks for starting this thread, I'll try to make uploading this "reset" sketch a habbit of mine too before starting anything new.