Auto-reset
If you have a board that doesn't support auto-reset, make sure that you reset the board a couple of seconds before uploading. You can also keep pressing the physical reset button on the Arduino board while uploading the code to the board.
If you have a board that doesn't support auto-reset, make sure that you reset the board a couple of seconds before uploading. You can also keep pressing the physical reset button on the Arduino board while uploading the code to the board.