arduino how to use buttons code example
Example: what does the button do on the arduino uno
The reset button does pretty much the same as unplugging the board and
plugging it back in. It restarts your program from the beginning.
The same thing happens when you program the board - the USB interface
presses the reset button for you. That then enters the bootloader for
a second or two so it can try and program it.