Table of Contents

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

Built-in Commands in the Same Category

← Built-in Command List