ja-jp_commands:reference:ibounceon
差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン前のリビジョン | |||
| ja-jp_commands:reference:ibounceon [2026/09/07 23:35] – 바깥 편집 127.0.0.1 | ja-jp_commands:reference:ibounceon [2026/09/08 00:53] (現在) – 바깥 편집 127.0.0.1 | ||
|---|---|---|---|
| 行 16: | 行 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); // 入力のON・OFF両方向にチャタリング除去時間を適用します。 | + | |
| - | 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(" | ||
| + | } | ||
| } | } | ||
| </ | </ | ||
| 行 30: | 行 41: | ||
| '' | '' | ||
| + | |||
| + | ===== 同じカテゴリの内蔵コマンド ===== | ||
| + | |||
| + | * [[: | ||
| + | * [[: | ||
| + | * [[: | ||
| [[: | [[: | ||
ja-jp_commands/reference/ibounceon.1788791736.txt.gz · 最終更新: by 127.0.0.1
