en-us_commands:reference:wdt_disable
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| en-us_commands:reference:wdt_disable [2026/09/08 00:53] – 바깥 편집 127.0.0.1 | en-us_commands:reference:wdt_disable [2026/09/14 20:30] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 14: | Line 14: | ||
| ===== Example ===== | ===== Example ===== | ||
| + | |||
| + | This example uses MPINO-16A8R8T digital input D22. When D22 becomes HIGH, it disables the watchdog once and does not enable it again. | ||
| <code cpp> | <code cpp> | ||
| + | bool watchdogActive = true; | ||
| + | |||
| void setup() { | void setup() { | ||
| - | #if defined(__AVR_ATmega2560__) | + | |
| - | | + | |
| - | #elif defined(__AVR_ATmega128__) | + | |
| - | WDT_ENABLE(WDT_1800MS); | + | |
| - | #endif | + | |
| } | } | ||
| void loop() { | void loop() { | ||
| - | | + | |
| - | if (maintenanceMode) { | + | WDT_DISABLE(); |
| - | WDT_DISABLE(); | + | |
| - | | + | |
| } | } | ||
| - | WDT(); | + | |
| + | delay(100); | ||
| } | } | ||
| </ | </ | ||
en-us_commands/reference/wdt_disable.1788796404.txt.gz · Last modified: by 127.0.0.1
