Restart Program Programically

Is there a way to restart a program through code? I looked around on the reference page and didn't see anything on there. Thanks.

Why do you want to restart the program? The reason that you can't find it is that a properly written sketch won't need restarting so it is seldom done.

The is a number of methods of resetting an Arduino via code:
https://www.google.ch/?gws_rd=ssl#newwindow=1&q=arduino+software+reset

Probably the most reliable method is to use the watchdog timer to trigger an occasional reset.

GregBlosh: Is there a way to restart a program through code? I looked around on the reference page and didn't see anything on there. Thanks.

Design your program so it is not necessary.

And I would certainly not be careless in the design of a program on the basis that the watchdog timer would pick up the pieces of my broken program. To my mind the watchdog timer is a last resort just in case I did not get everything correct.

Of course there are other uses for the watchdog timer - I am only referring to its use as an alternative to careful program writing and testing.

...R Planning and Implementing a Program

Thanks for the suggestions! The suggestions sparked some deep thinking which produced some code that kind of restarts the program using the loop function.

GregBlosh: Thanks for the suggestions! The suggestions sparked some deep thinking which produced some code that kind of restarts the program using the loop function.

Hopefully not by just calling loop. That is a recipe for a crash.

GregBlosh:
The suggestions sparked some deep thinking which produced some code that kind of restarts the program using the loop function.

That is still a flawed approach. The whole purpose of the loop() function is that it repeats indefinitely and you should organize your code so it repeats hundreds or thousands of times per second.

…R