Arduino DUE Reset via software


i'm just a begginer so i want to ask you for your help!

i need my arduino reset every 10sec.

how can i do that without any extra hardware?

there is a software solution?

int resetPin = 12;// look 12 digital out 5v and go go arduino reset pin cable

unsigned long currentTime; unsigned long loopTime; // the setup routine runs once when you press reset: void setup() { digitalWrite(resetPin, LOW); delay(200); // initialize the digital pin as an output.

pinMode(resetPin, OUTPUT); Serial.begin(9600);//initialize Serial Port Serial.println("reset");//print reset to know the program has been reset and //the setup function happened delay(200); currentTime = millis(); loopTime = currentTime; }

// the loop routine runs over and over again forever: void loop() {

currentTime = millis(); if(currentTime >= (loopTime + 10000)){ digitalWrite(resetPin, HIGH); // toggles the reset loopTime = currentTime; // Updates loopTime } else digitalWrite(resetPin, LOW); }

Arlove's solution requires a resistor between your digital pin and reset pin. Also, this solution is not recommended because you cant hold the reset pin long enough to reset things properly.

Use a watchdog timer, here is a link to a forum. You will have to modify a few libraries

Thanks epic_roboworks,

i'll follow your answer, i have time to learn about the whatchdog

Okay, this is an XY problem, except the solution was simple.

WHY would you ever want to do this?