0
votes

I am working on the temperature project using arduino to collect temperature. But sometimes arduino hang there so I have to unplug cord and plug it back in to restart the arduino. I do not when it is going to hang up again. So I decide to do some research on the internet but no luck for that. Here is the article I read about resetting arduino code with watchdog timer library.(unfortunately, it only work for arduino uno) If someone has any idea how to reset arduino mega 2560 code. Please help !!

1
You should consider to ask it on An arduino stackexchange website. - Aracthor
Try reading asm datasheet and beware of answers that merely point the program counter. That's not the same as a full reset. - TomServo

1 Answers

1
votes

You can reset the Arduino using the following syntax: First declare a function

    void(* resetFunc) (void) = 0;//declare reset function at address 0

Then call the function wherever you want to reset the controller.

    resetFunc();