Skip to content

Repository files navigation

107-Arduino-Debug

Arduino Library BadgeCompile ExamplesCheck ArduinoCheck keywords.txtGeneral Formatting ChecksSpell Check

Arduino library for providing convenient macros for printf-style debugging.

This library works for

Example

#defineDBG_ENABLE_ERROR
#defineDBG_ENABLE_WARNING
#defineDBG_ENABLE_INFO
#defineDBG_ENABLE_DEBUG
#defineDBG_ENABLE_VERBOSE
#include<107-Arduino-Debug.hpp>/* ... */DEBUG_INSTANCE(80, Serial);
/* ... */voidsetup()
{
Serial.begin(9600);
while (!Serial) { }
DBG_ERROR ("A serious error has occurred during operation X: %d", -42);
DBG_WARNING("No connection to %s, retrying in %d seconds ...", "127.0.0.1", 5);
DBG_INFO ("Did you know you can also print octal values: %o", 0xCA);
DBG_DEBUG ("MCP2515 CANSTAT = 0x%02X", 0xFE);
DBG_VERBOSE("You are probably aware that PI = %4.2f", PI);
}
/* ... */

Note: If you enable pretty printing using 4-bit shell color escape sequences via prettyPrintOn then you'll need to start minicom with --color=on:

minicom -D /dev/ttyACM0 --color=on

About

Arduino library for providing convenient macros for printf-style debugging.

Topics

Resources

Stars

5 stars

Watchers

4 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages