Is it possible to reset an Arduino (i.e., to reboot it) from code (i.e from the sketch itself)? I know that is possible with a special circuit but is there a chance to make it just with code?
Below is my code and the comment //reset
is where I want to force a reset.
#include <TrueRandom.h>
int i;
int randSeed;
long randNumber;
void setup(){
Serial.begin(9600);
Serial.println("20 pseudo Zufallszahlen:");
for (i=1;i<=20;i++) Serial.print(random(10));
Serial.println();
Serial.println();
//randomSeed(TrueRandom.random());
randSeed = analogRead (A0);
randomSeed(randSeed);
Serial.print("Der 'seed' Wert: ");
Serial.println(randSeed);
Serial.println();
Serial.println("20 Zufallszahlen mit analogem 'seed' Wert:");
for (i=1;i<=20;i++) Serial.print(random(10));
Serial.println();
Serial.println("---------------------------");
Serial.println();
delay(500);
//reset
}
void loop() {
}
I want to reset the micro-controller at the end of the setup function to show the effect of random numbers with and without a seed.