The trick will be figuring out how to only do the reset 'once per power cycle'. So the 'first' time the sketch runs, it sets some flag, then resets itself. The 'second' time it checks the flag state, and doesn't reset. Tricky.

Also you don't hold the pin HIGH using the diode, that is done with a pull-up resistor that is probably already on the board. What board are you using?

The trick will be figuring out how to only do the reset 'once per power cycle'. So the 'first' time the sketch runs, it sets some flag, then resets itself. The 'second' time it checks the flag state, and doesn't reset. Tricky.

If that needs to be done you may need to modify the bootloader to detect thesource of the interrupt and clear the flags.

Hi all.Being a bit new to Arduino, I have a Arduino BT (Bluetooth) witch seems to require hit the rest buton everytime I upload to the board, or everytime I hit run on Processing. since I'm putting the Arduino in a closed box, I want to connect an exterior button so I can reset from outside. Any ideas how to do it? Can this be done from the code like previously anounced here?Thank you for your help

Hmmm, I only just noticed this thread but Atmel specifically state you should not try to reset the device using its own digital out due to the fact the time the reset line is held is not long enough because when the reset starts the output pin's state will change.

It's been discussed on the forums multiple times, if Google can find it...