en-us_commands:reference:ibounceoff
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| en-us_commands:reference:ibounceoff [2026/09/07 23:35] – 바깥 편집 127.0.0.1 | en-us_commands:reference:ibounceoff [2026/09/08 00:53] (current) – 바깥 편집 127.0.0.1 | ||
|---|---|---|---|
| Line 16: | Line 16: | ||
| <code cpp> | <code cpp> | ||
| + | const uint8_t START_INPUT = 0; | ||
| + | const uint8_t STOP_INPUT = 1; | ||
| + | const uint8_t RUN_OUTPUT = 32; | ||
| + | |||
| void setup() { | void setup() { | ||
| - | | + | |
| } | } | ||
| void loop() { | void loop() { | ||
| - | bool stableInput = Ibounce(0, 20); // Applies a debounce time in both ON and OFF directions of the input. | + | |
| - | bool onDelayed | + | |
| - | bool offDelayed | + | const bool run = start && !stop; |
| + | digitalWrite(RUN_OUTPUT, | ||
| + | |||
| + | static bool previousRun = false; | ||
| + | if (run != previousRun) { | ||
| + | previousRun = run; | ||
| + | Serial.println(run ? F(" | ||
| + | } | ||
| } | } | ||
| </ | </ | ||
| Line 30: | Line 41: | ||
| The '' | The '' | ||
| + | |||
| + | ===== Built-in Commands in the Same Category ===== | ||
| + | |||
| + | * [[: | ||
| + | * [[: | ||
| + | * [[: | ||
| [[: | [[: | ||
en-us_commands/reference/ibounceoff.1788791733.txt.gz · Last modified: by 127.0.0.1
