en-us_commands:reference:ictu
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| en-us_commands:reference:ictu [2026/09/07 21:52] – 만듦 - 바깥 편집 127.0.0.1 | en-us_commands:reference:ictu [2026/09/08 00:53] (current) – 바깥 편집 127.0.0.1 | ||
|---|---|---|---|
| Line 10: | Line 10: | ||
| ^ Command ^ Arguments ^ Return Value ^ Operation ^ | ^ Command ^ Arguments ^ Return Value ^ Operation ^ | ||
| - | | '' | + | | '' |
| + | |||
| + | **Beginner-friendly explanation** | ||
| + | |||
| + | '' | ||
| + | |||
| + | Read the call '' | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | Call it continuously from '' | ||
| Line 16: | Line 29: | ||
| <code cpp> | <code cpp> | ||
| + | const uint8_t COUNTER_ID = 0; | ||
| + | const uint8_t ITEM_SENSOR_PIN = 0; | ||
| + | const uint8_t RESET_BUTTON_PIN = 1; | ||
| + | const uint8_t FULL_LAMP_PIN = LED_BUILTIN; | ||
| + | const int32_t BOX_CAPACITY = 5; | ||
| + | |||
| + | void setup() { | ||
| + | Serial.begin(115200); | ||
| + | } | ||
| + | |||
| void loop() { | void loop() { | ||
| - | bool pulse = digitalRead(0); | + | |
| + | const bool resetButton = digitalRead(RESET_BUTTON_PIN) == HIGH; | ||
| + | const bool boxFull = Ictu(COUNTER_ID, | ||
| + | digitalWrite(FULL_LAMP_PIN, | ||
| - | if (Ictu(40, pulse, false, 10)) { | + | |
| - | | + | |
| + | | ||
| } | } | ||
| + | previousBoxFull = boxFull; | ||
| } | } | ||
| </ | </ | ||
| Line 27: | Line 55: | ||
| ===== Precautions ===== | ===== Precautions ===== | ||
| - | * The previous fixed 0~31 restriction has been removed. However, the argument type is '' | + | * '' |
| - | * If insufficient memory prevents allocation of counter state, counter commands return | + | * When '' |
| - | * Once created, counter state is retained while the program runs. | + | * Set '' |
| + | * Input changes can be missed when sensor pulses are faster than '' | ||
| + | * Use a different '' | ||
| + | * Use '' | ||
| + | |||
| + | ===== Built-in Commands in the Same Category ===== | ||
| + | |||
| + | * [[: | ||
| + | * [[: | ||
| + | * [[: | ||
| + | * [[: | ||
| + | * [[: | ||
| [[: | [[: | ||
en-us_commands/reference/ictu.1788785566.txt.gz · Last modified: by 127.0.0.1
