en-us_commands:reference:isetcount
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| en-us_commands:reference:isetcount [2026/09/07 21:52] – 만듦 - 바깥 편집 127.0.0.1 | en-us_commands:reference:isetcount [2026/09/08 00:53] (current) – 바깥 편집 127.0.0.1 | ||
|---|---|---|---|
| Line 16: | Line 16: | ||
| <code cpp> | <code cpp> | ||
| - | bool Ictu(uint8_t | + | const uint8_t |
| - | bool Ictd(uint8_t counter_id, bool CD, bool LOAD, int32_t PV); | + | const uint8_t PRESET_BUTTON_PIN = 0; |
| - | bool Ictud(uint8_t counter_id, bool CU, bool CD, bool RESET, bool LOAD, int32_t PV); | + | const int32_t |
| - | int32_t IgetCount(uint8_t counter_id); | + | |
| - | void IsetCount(uint8_t counter_id, int32_t value); | + | void setup() { |
| - | bool IctudDownState(uint8_t counter_id); | + | Serial.begin(115200); |
| + | } | ||
| + | |||
| + | void loop() { | ||
| + | const bool presetButton = digitalRead(PRESET_BUTTON_PIN) == HIGH; | ||
| + | | ||
| + | |||
| + | if (presetButton && !previousButton) { | ||
| + | IsetCount(COUNTER_ID, PRESET_COUNT); // Change the specified counter' | ||
| + | | ||
| + | } | ||
| + | previousButton = presetButton; | ||
| + | } | ||
| </ | </ | ||
| Line 29: | Line 41: | ||
| * If insufficient memory prevents allocation of counter state, counter commands return '' | * If insufficient memory prevents allocation of counter state, counter commands return '' | ||
| * Once created, counter state is retained while the program runs. | * Once created, counter state is retained while the program runs. | ||
| + | |||
| + | ===== Built-in Commands in the Same Category ===== | ||
| + | |||
| + | * [[: | ||
| + | * [[: | ||
| + | * [[: | ||
| + | * [[: | ||
| + | * [[: | ||
| [[: | [[: | ||
en-us_commands/reference/isetcount.1788785568.txt.gz · Last modified: by 127.0.0.1
