User Tools

Site Tools


en-us_commands:reference:wdt

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en-us_commands:reference:wdt [2026/09/07 21:52] – 만듦 - 바깥 편집 127.0.0.1en-us_commands:reference:wdt [2026/09/08 00:53] (current) – 바깥 편집 127.0.0.1
Line 16: Line 16:
  
 <code cpp> <code cpp>
 +void setup() {
 +#if defined(__AVR_ATmega128__)
 +  WDT_ENABLE(WDT_900MS);  // Set the watchdog timeout and start operation.
 +#elif defined(__AVR_ATmega2560__)
 +  WDT_ENABLE(WDT_1S);  // Set the watchdog timeout and start operation.
 +#endif
 +}
 +
 void loop() { void loop() {
-  // Normal control processing +  WDT();  // Refresh the watchdog before its timeout expires.
-  WDT();+
 } }
 </code> </code>
Line 27: Line 34:
   * Do not set a timeout shorter than the longest normal processing time.   * Do not set a timeout shorter than the longest normal processing time.
   * Do not hide program faults by placing ''WDT()'' where it always executes unconditionally.   * Do not hide program faults by placing ''WDT()'' where it always executes unconditionally.
 +
 +===== Built-in Commands in the Same Category =====
 +
 +  * [[:en-us_commands:reference:wdt_enable|WDT_ENABLE() View detailed description]]
 +  * [[:en-us_commands:reference:wdt_disable|WDT_DISABLE() View detailed description]]
  
 [[:en-us_commands:builtin|← Built-in Command List]] [[:en-us_commands:builtin|← Built-in Command List]]
  
en-us_commands/reference/wdt.1788785569.txt.gz · Last modified: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki