User Tools

Site Tools


en-us_commands:reference:debugln

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en-us_commands:reference:debugln [2026/09/07 21:52] – 만듦 - 바깥 편집 127.0.0.1en-us_commands:reference:debugln [2026/09/08 00:53] (current) – 바깥 편집 127.0.0.1
Line 26: Line 26:
  
 <code cpp> <code cpp>
-debugln(analogRead(A0));+const bool DEBUG_MODE = true; 
 + 
 +void setup() { 
 +  if (DEBUG_MODE) { 
 +    debugStart(115200);  // Set the port and baud rate for debug output. 
 +  } 
 +
 + 
 +void loop() { 
 +  checkInput(); 
 +  checkOutput(); 
 +
 + 
 +void checkInput() { 
 +  debug("AI0=");  // Output values only when debugging is enabled. 
 +  debugln(analogRead(A0));  // Read the raw analog value of the specified channel. / Output the debug value followed by a newline. 
 +
 + 
 +void checkOutput() { 
 +  debug("millis=");  // Output values only when debugging is enabled. 
 +  debugln(millis());  // Output the debug value followed by a newline. 
 +}
 </code> </code>
  
Line 34: Line 55:
   * Rapid repeated output can slow the control cycle and communication responses.   * Rapid repeated output can slow the control cycle and communication responses.
   * Stop unnecessary Debug output before deploying for operation.   * Stop unnecessary Debug output before deploying for operation.
 +
 +===== Built-in Commands in the Same Category =====
 +
 +  * [[:en-us_commands:reference:debugstart|debugStart() View detailed description]]
 +  * [[:en-us_commands:reference:debugstop|debugStop() View detailed description]]
 +  * [[:en-us_commands:reference:debugstate|debugState() View detailed description]]
 +  * [[:en-us_commands:reference:debug|debug() View detailed description]]
  
 [[:en-us_commands:builtin|← Built-in Command List]] [[:en-us_commands:builtin|← Built-in Command List]]
  
en-us_commands/reference/debugln.1788785565.txt.gz · Last modified: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki