en-us_commands:reference:wdt_disable
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| en-us_commands:reference:wdt_disable [2026/09/07 21:52] – 만듦 - 바깥 편집 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> | ||
| - | WDT_DISABLE(); | + | bool watchdogActive = true; |
| + | |||
| + | void setup() { | ||
| + | WDT_ENABLE(WDT_2S); | ||
| + | } | ||
| + | |||
| + | void loop() { | ||
| + | if (watchdogActive && digitalRead(22) == HIGH) { | ||
| + | | ||
| + | watchdogActive = false; | ||
| + | } | ||
| + | if (watchdogActive) WDT(); | ||
| + | delay(100); | ||
| + | } | ||
| </ | </ | ||
| Line 24: | Line 39: | ||
| * 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 '' | * Do not hide program faults by placing '' | ||
| + | |||
| + | ===== Built-in Commands in the Same Category ===== | ||
| + | |||
| + | * [[: | ||
| + | * [[: | ||
| [[: | [[: | ||
en-us_commands/reference/wdt_disable.1788785569.txt.gz · Last modified: by 127.0.0.1
