====== debugState() ====== ''debugState()'' returns whether debug output is enabled. {{:en-us_commands:reference:debugstate.svg?900|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:debugstart|debugStart() View detailed description]] * [[:en-us_commands:reference:debugstop|debugStop() View detailed description]] * [[:en-us_commands:reference:debug|debug() View detailed description]] * [[:en-us_commands:reference:debugln|debugln() View detailed description]] [[:en-us_commands:builtin|← Built-in Command List]]