User Tools

Site Tools


en-us_commands:reference:debugstate

debugState()

debugState() returns whether debug output is enabled.

debugState command operation flow

bool debugState()

Commands

Command Arguments Return Value Operation
debugState() None bool Returns whether debug output is enabled.

Example

void setup() {
  debugStart(Serial, 115200, SERIAL_8N1);  // Start the serial port for debug output.
}
 
void loop() {
  if (millis() >= 5000 && debugState()) debugStop();  // Stop debug output after five seconds.
  if (debugState()) {  // Check whether debug output is enabled.
    debugln(millis());  // Print elapsed time while debugging is enabled.
  }
  delay(500);
}

Precautions

  • Do not use the same port for Debug and product communication.
  • Rapid repeated output can slow the control cycle and communication responses.
  • Stop unnecessary Debug output before deploying for operation.

Built-in Commands in the Same Category

en-us_commands/reference/debugstate.txt · Last modified: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki