ja-jp_commands:reference:ibounceoff
差分
このページの2つのバージョン間の差分を表示します。
| 次のリビジョン | 前のリビジョン | ||
| ja-jp_commands:reference:ibounceoff [2026/09/07 21:53] – 만듦 - 바깥 편집 127.0.0.1 | ja-jp_commands:reference:ibounceoff [2026/09/08 00:53] (現在) – 바깥 편집 127.0.0.1 | ||
|---|---|---|---|
| 行 16: | 行 16: | ||
| <code cpp> | <code cpp> | ||
| - | if (!IbounceOff(0, 50)) { | + | const uint8_t START_INPUT = 0; |
| - | digitalWrite(32, LOW); | + | const uint8_t STOP_INPUT = 1; |
| + | const uint8_t RUN_OUTPUT = 32; | ||
| + | |||
| + | void setup() { | ||
| + | Serial.begin(115200); | ||
| + | } | ||
| + | |||
| + | void loop() { | ||
| + | const bool start = IbounceOn(START_INPUT, | ||
| + | const bool stop = IbounceOff(STOP_INPUT, | ||
| + | const bool run = start && !stop; | ||
| + | digitalWrite(RUN_OUTPUT, run ? HIGH : LOW); | ||
| + | |||
| + | static bool previousRun = false; | ||
| + | if (run != previousRun) { | ||
| + | previousRun = run; | ||
| + | Serial.println(run ? F(" | ||
| + | } | ||
| } | } | ||
| </ | </ | ||
| 行 24: | 行 41: | ||
| '' | '' | ||
| + | |||
| + | ===== 同じカテゴリの内蔵コマンド ===== | ||
| + | |||
| + | * [[: | ||
| + | * [[: | ||
| + | * [[: | ||
| [[: | [[: | ||
ja-jp_commands/reference/ibounceoff.1788785589.txt.gz · 最終更新: by 127.0.0.1
