8

Does anyone know how to prevent the Uno from running the last program when it's powered on?

Many times I have changed hardware and wiring without clearing the program first. Then when I power it on to upload the new program it will run the old program until it's uploaded. This has many potential unwanted effects when the old program is running with the new hardware installed.

Ambo100
  • 107
  • 7
perigalacticon
  • 357
  • 4
  • 14

1 Answers1

14

The simplest thing is to upload the new program before connecting the hardware.

If this isn't practical, connect a jumper wire from the Reset pin to ground (Gnd) before powering it on. This will hold in a reset state, and the program won't run.

Then, compile and upload your program. As it starts to upload remove the reset wire. That should upload it without running any existing program.

Nick Gammon
  • 38,883
  • 13
  • 69
  • 125