Table of Contents

debugln()

debugln() outputs a debug value followed by a newline.

debugln command operation flow

void debugln()
void debugln(const __FlashStringHelper* value)
void debugln(const String& value)
void debugln(const char value[])
void debugln(char value)
void debugln(unsigned char value, int base = DEC)
void debugln(int value, int base = DEC)
void debugln(unsigned int value, int base = DEC)
void debugln(long value, int base = DEC)
void debugln(unsigned long value, int base = DEC)
void debugln(double value, int digits = 2)

Commands

Command Arguments Return Value Operation
debugln() None void Outputs a debug value followed by a newline.

Example

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.
}

Precautions

Built-in Commands in the Same Category

← Built-in Command List