====== IctudDownState() ====== ''IctudDownState()''はUp/Downカウンタの下限完了状態を返します。 {{:ja-jp_commands:reference:ictuddownstate.svg?900|IctudDownState コマンドの動作フロー}} ''bool IctudDownState(uint8_t counter_id)'' ===== コマンド ===== ^ コマンド ^ 引数 ^ 戻り値 ^ 動作 ^ | ''IctudDownState(counter_id)'' | ''uint8_t counter_id'' — カウンタ番号。''uint8_t''の範囲のため''0'' ~ ''255''を使用可能 | ''bool'' | Up/Downカウンタの下限完了状態を返します。 | ===== 使用例 ===== MPINO-8A4R(T)-SのP0・P1入力とP33出力を使用する例です。 const uint8_t COUNTER_ID = 5; const int32_t RACK_CAPACITY = 100; void setup() { Serial.begin(115200); } void loop() { const bool entered = digitalRead(0) == HIGH; const bool exited = digitalRead(1) == HIGH; Ictud(COUNTER_ID, entered, exited, false, false, RACK_CAPACITY); // 加算入力と減算入力を1つのカウンタで処理します。 const bool rackEmpty = IctudDownState(COUNTER_ID); // アップ/ダウンカウンタの下限完了状態を返します。 digitalWrite(33, rackEmpty ? HIGH : LOW); } ===== 注意事項 ===== * 従来の0~31固定制限は削除されました。ただし引数型が''uint8_t''のため、最大IDは''255''です。 * メモリ不足でカウンタ状態を確保できない場合、カウンタコマンドは''false''または''0''を返します。 * 一度作成したカウンタ状態はプログラム実行中保持されます。 ===== 同じカテゴリの内蔵コマンド ===== * [[:ja-jp_commands:reference:ictu|Ictu() 詳細説明を見る]] * [[:ja-jp_commands:reference:ictd|Ictd() 詳細説明を見る]] * [[:ja-jp_commands:reference:ictud|Ictud() 詳細説明を見る]] * [[:ja-jp_commands:reference:igetcount|IgetCount() 詳細説明を見る]] * [[:ja-jp_commands:reference:isetcount|IsetCount() 詳細説明を見る]] [[:ja-jp_commands:builtin|← 内蔵コマンド一覧]]