Restart using the WDT

Hi Guys

Remember I’m a novice and some would say a bit of an idiot … … … .

I’m trying to use the WDTimer to invoke a restart of my sketch if certain conditions are met … …however, I’m very concerned about all the warnings I’ve found about a wrong code causing a perpetual loop …

I’ve tried the example in the library a couple of ways round but I’m clearly miles away. Part of the problem for me is that there seems to be quite a lot in the library example I don’t need but my understanding isn’t too good.

I’ve attached a small sketch with my attempt and the bit of my code I want to use it with … … I appreciate it won’t compile but could somebody please let me know if I’m on the right track.

Thanks

S

Soft_Restart_Sample.ino (357 Bytes)

{
void loop() {
  
}

Why is this function inside a block?

Because if it wasn't you'd have nothing to moan at me about !! :D

S

Musicmanager: Because if it wasn't you'd have nothing to moan at me about !! :D

S

Well, OK, as long as you don't have any unrealistic expectations that the code will compile or work.

So, what WAS the point of the post?

Paul .. .. ..

I've attached a small sketch with my attempt and the bit of my code I want to use it with .. .. I appreciate it won't compile but could somebody please let me know if I'm on the right track.

As you said to me yesterday ... ... If you read .. .. .. .

S