en-us_commands:reference:iup
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| en-us_commands:reference:iup [2026/09/07 21:52] – 만듦 - 바깥 편집 127.0.0.1 | en-us_commands:reference:iup [2026/09/08 00:53] (current) – 바깥 편집 127.0.0.1 | ||
|---|---|---|---|
| Line 16: | Line 16: | ||
| <code cpp> | <code cpp> | ||
| - | if (Iup(0, | + | const uint8_t COMMAND_INPUT = 0; |
| - | digitalWrite(32, HIGH); | + | const uint8_t MOTOR_OUTPUT = 32; |
| + | |||
| + | void setup() { | ||
| + | Serial.begin(115200); | ||
| + | } | ||
| + | |||
| + | void loop() { | ||
| + | const bool input = IdigitalRead(COMMAND_INPUT, | ||
| + | const bool started = Iup(0, | ||
| + | const bool stopped = Idown(0, input); // Return true only at the instant the input changes from ON to OFF. | ||
| + | static bool run = false; | ||
| + | Ialt(started, | ||
| + | |||
| + | digitalWrite(MOTOR_OUTPUT, run ? HIGH : LOW); | ||
| + | if (started) Serial.println(F(" | ||
| + | if (stopped) Serial.println(F(" | ||
| } | } | ||
| </ | </ | ||
| Line 24: | Line 39: | ||
| Using the same '' | Using the same '' | ||
| + | |||
| + | ===== Built-in Commands in the Same Category ===== | ||
| + | |||
| + | * [[: | ||
| [[: | [[: | ||
en-us_commands/reference/iup.1788785569.txt.gz · Last modified: by 127.0.0.1
