ユーザ用ツール

サイト用ツール


ja-jp_commands:reference:debugstate

差分

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

この比較画面へのリンク

次のリビジョン
前のリビジョン
ja-jp_commands:reference:debugstate [2026/09/07 21:53] – 만듦 - 바깥 편집 127.0.0.1ja-jp_commands:reference:debugstate [2026/09/14 20:30] (現在) – 外部編集 127.0.0.1
行 16: 行 16:
  
 <code cpp> <code cpp>
-if (debugState()) debugln(F("running"));+void setup() { 
 +  debugStart(Serial, 115200, SERIAL_8N1);  // デバッグ出力用シリアルポートを開始します。 
 +
 + 
 +void loop() { 
 +  if (millis() >= 5000 && debugState()) debugStop();  // 5秒後にデバッグ出力を停止します。 
 +  if (debugState()) {  // デバッグ出力が有効か確認します。 
 +    debugln(millis());  // 有効な間、経過時間を表示します。 
 +  } 
 +  delay(500); 
 +}
 </code> </code>
  
行 24: 行 34:
   * 高速で出力を繰り返すと制御周期と通信応答が遅くなる場合があります。   * 高速で出力を繰り返すと制御周期と通信応答が遅くなる場合があります。
   * 運転用に配布する前に不要なDebug出力を停止します。   * 運転用に配布する前に不要なDebug出力を停止します。
 +
 +===== 同じカテゴリの内蔵コマンド =====
 +
 +  * [[:ja-jp_commands:reference:debugstart|debugStart() 詳細説明を見る]]
 +  * [[:ja-jp_commands:reference:debugstop|debugStop() 詳細説明を見る]]
 +  * [[:ja-jp_commands:reference:debug|debug() 詳細説明を見る]]
 +  * [[:ja-jp_commands:reference:debugln|debugln() 詳細説明を見る]]
  
 [[:ja-jp_commands:builtin|← 内蔵コマンド一覧]] [[:ja-jp_commands:builtin|← 内蔵コマンド一覧]]
  
ja-jp_commands/reference/debugstate.1788785588.txt.gz · 最終更新: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki