See
#includeThis code comes from http://forum.arduino.cc/index.php?topic=128717.msg968831#msg968831void setup () { Serial.begin (115200); Serial.println ("Restarted."); wdt_enable (WDTO_1S); // reset after one second, if no "pat the dog" received } // end of setup void loop () { Serial.println ("Entered loop ..."); wdt_reset (); // give me another second to do stuff (pat the dog) while (true) ; // oops, went into a loop } // end of loop
Obviously this can be used to trigger a restart when you detect an error (if error --> while(1){})
No comments:
Post a Comment