ja-jp_commands:reference:isetcount
差分
このページの2つのバージョン間の差分を表示します。
| 次のリビジョン | 前のリビジョン | ||
| ja-jp_commands:reference:isetcount [2026/09/07 21:53] – 만듦 - 바깥 편집 127.0.0.1 | ja-jp_commands:reference:isetcount [2026/09/08 00:53] (現在) – 바깥 편집 127.0.0.1 | ||
|---|---|---|---|
| 行 16: | 行 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, | + | 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; | ||
| + | static | ||
| + | |||
| + | if (presetButton && !previousButton) { | ||
| + | IsetCount(COUNTER_ID, PRESET_COUNT); // 指定カウンタの現在値を変更します。 | ||
| + | | ||
| + | } | ||
| + | previousButton = presetButton; | ||
| + | } | ||
| </ | </ | ||
| 行 29: | 行 41: | ||
| * メモリ不足でカウンタ状態を確保できない場合、カウンタコマンドは'' | * メモリ不足でカウンタ状態を確保できない場合、カウンタコマンドは'' | ||
| * 一度作成したカウンタ状態はプログラム実行中保持されます。 | * 一度作成したカウンタ状態はプログラム実行中保持されます。 | ||
| + | |||
| + | ===== 同じカテゴリの内蔵コマンド ===== | ||
| + | |||
| + | * [[: | ||
| + | * [[: | ||
| + | * [[: | ||
| + | * [[: | ||
| + | * [[: | ||
| [[: | [[: | ||
ja-jp_commands/reference/isetcount.1788785591.txt.gz · 最終更新: by 127.0.0.1
