ユーザ用ツール

サイト用ツール


ja-jp_commands:reference:ictd

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
ja-jp_commands:reference:ictd [2026/09/07 23:35] – 바깥 편집 127.0.0.1ja-jp_commands:reference:ictd [2026/09/14 20:30] (現在) – 外部編集 127.0.0.1
行 14: 行 14:
  
 ===== 使用例 ===== ===== 使用例 =====
 +
 +MPINO-8A4R(T)-SのP0・P1入力とP32出力を使用する例です。
  
 <code cpp> <code cpp>
行 24: 行 26:
  
 void loop() { void loop() {
-  const bool shipped = IdigitalRead(0, 5);  // 入力を連続して複数回読み、すべて一致した場合のみ状態を更新します。HIGHとLOWが混在する場合は前の安定状態を保持します。 +  const bool shipped = digitalRead(0) == HIGH; 
-  const bool loadQuantity = IdigitalRead(1, 5);  // 入力を連続して複数回読み、すべて一致した場合のみ状態を更新します。HIGHとLOWが混在する場合は前の安定状態を保持します。+  const bool loadQuantity = digitalRead(1) == HIGH;
   const bool empty = Ictd(COUNTER_ID, shipped, loadQuantity, START_QUANTITY);  // 設定値をロード後、入力の立ち上がりごとに現在値を減算します。   const bool empty = Ictd(COUNTER_ID, shipped, loadQuantity, START_QUANTITY);  // 設定値をロード後、入力の立ち上がりごとに現在値を減算します。
   digitalWrite(32, empty ? HIGH : LOW);   digitalWrite(32, empty ? HIGH : LOW);
行 36: 行 38:
   * メモリ不足でカウンタ状態を確保できない場合、カウンタコマンドは''false''または''0''を返します。   * メモリ不足でカウンタ状態を確保できない場合、カウンタコマンドは''false''または''0''を返します。
   * 一度作成したカウンタ状態はプログラム実行中保持されます。   * 一度作成したカウンタ状態はプログラム実行中保持されます。
 +
 +===== 同じカテゴリの内蔵コマンド =====
 +
 +  * [[:ja-jp_commands:reference:ictu|Ictu() 詳細説明を見る]]
 +  * [[:ja-jp_commands:reference:ictud|Ictud() 詳細説明を見る]]
 +  * [[:ja-jp_commands:reference:igetcount|IgetCount() 詳細説明を見る]]
 +  * [[:ja-jp_commands:reference:isetcount|IsetCount() 詳細説明を見る]]
 +  * [[:ja-jp_commands:reference:ictuddownstate|IctudDownState() 詳細説明を見る]]
  
 [[:ja-jp_commands:builtin|← 内蔵コマンド一覧]] [[:ja-jp_commands:builtin|← 内蔵コマンド一覧]]
  
ja-jp_commands/reference/ictd.1788791737.txt.gz · 最終更新: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki