{"id":77510,"date":"2018-11-14T17:40:26","date_gmt":"2018-11-14T17:40:26","guid":{"rendered":"https:\/\/randomnerdtutorials.com\/?p=77510"},"modified":"2023-08-15T22:13:14","modified_gmt":"2023-08-15T22:13:14","slug":"serialdebug-library-arduino-ide","status":"publish","type":"post","link":"https:\/\/randomnerdtutorials.com\/serialdebug-library-arduino-ide\/","title":{"rendered":"Better Debugging for Arduino IDE: SerialDebug Library (Part 1)"},"content":{"rendered":"\n<div style=\"padding: 10px; line-height: 1.2; text-align: center; background-color: #f5f5f5; margin-bottom: 10px;\">This tutorial was written by Jo\u00e3o Lopes and edited by Sara Santos.<\/div>\n\n\n\n<p>The SerialDebug library allows you to improve and do better debugging in Arduino IDE. In this post, Jo\u00e3o Lopes (creator of the SerialDebug library) shows you how to use it in your projects.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/Serial-debug-arduino-ide.jpg?resize=1200%2C675&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-77567\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/Serial-debug-arduino-ide.jpg?w=1280&amp;quality=100&amp;strip=all&amp;ssl=1 1280w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/Serial-debug-arduino-ide.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/Serial-debug-arduino-ide.jpg?resize=768%2C432&amp;quality=100&amp;strip=all&amp;ssl=1 768w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/Serial-debug-arduino-ide.jpg?resize=1024%2C576&amp;quality=100&amp;strip=all&amp;ssl=1 1024w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure><\/div>\n\n\n<p class=\"rntbox rntcred\"><span style=\"font-weight: 400;\"><strong>Warning: <\/strong> <strong>The developer of this tool is no longer updating this project<\/strong><\/span>, but the code is still available on GitHub.<\/p>\n\n\n\n<p>After programming the ESP32 using ESP-IDF, Jo\u00e3o noticed that debugging for Arduino IDE needed some improvement. So, he created the <a href=\"https:\/\/github.com\/JoaoLopesF\/SerialDebug\" target=\"_blank\" rel=\"noopener noreferrer\">SerialDebug library<\/a> to bring better debugging to Arduino IDE. He also created a desktop application called <a href=\"https:\/\/github.com\/JoaoLopesF\/SerialDebug\/tree\/master\/SerialDebugApp\" target=\"_blank\" rel=\"noopener noreferrer\">SerialDebugApp<\/a> that adds a UI and other useful functionalities.<\/p>\n\n\n\n<p>To show you all the useful features of the SerialDebug library and the SerialDebugApp, he created three tutorials dedicated to this subject:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Part 1 &#8211; Using debug with levels (currently reading)<\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/software-debugger-arduino-ide-serialdebug-library\/\">Part 2 &#8211; Simple Software Debugger<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/serialdebugapp-arduino-ide-serialdebug-library\/\">Part 3 &#8211; SerialDebugApp<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Using Debug Levels<\/h2>\n\n\n\n<p>The ESP-IDF has excellent debug output: the ESP-IDF logging, it has debug levels and displays the debug messages on your serial monitor with different colors accordingly to its level.<\/p>\n\n\n\n<p>However, we don\u2019t have this feature on the Arduino IDE. This motivated me (Jo\u00e3o) to make a library for the Arduino IDE: the SerialDebug library, which enables debugging with levels and other functionalities.<\/p>\n\n\n\n<p>The following figure shows the SerialDebugApp, companion app for SerialDebug library.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"708\" height=\"620\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/serialdebugapp_debugger.jpg?resize=708%2C620&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-77511\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/serialdebugapp_debugger.jpg?w=708&amp;quality=100&amp;strip=all&amp;ssl=1 708w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/serialdebugapp_debugger.jpg?resize=300%2C263&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 708px) 100vw, 708px\" \/><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\">Why are debug levels important?<\/h3>\n\n\n\n<p>Debug levels allow you to set a level for each message according to its importance, and thus improve the debug. If we have a project full of &#8220;<em>Serial.print<\/em>&#8220;, it is difficult to see, because much is generated in the Serial monitor, and there isn\u2019t a specific order in the debug messages.<\/p>\n\n\n\n<p>However, using SerialDebug levels, we can have a project full of debug messages via the Serial Monitor or SerialDebugApp. You can set the debug to &#8220;Verbose&#8221; to have all messages printed, or to &#8220;Debug&#8221; to display only the important messages.<\/p>\n\n\n\n<p>See this hypothetical example:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"697\" height=\"432\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/debug_levels_messages.png?resize=697%2C432&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-77513\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/debug_levels_messages.png?w=697&amp;quality=100&amp;strip=all&amp;ssl=1 697w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/debug_levels_messages.png?resize=300%2C186&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 697px) 100vw, 697px\" \/><\/figure><\/div>\n\n\n<p>When the level gets higher, the number of messages decreases.<\/p>\n\n\n\n<p>For projects with SerialDebug, we can use the Arduino IDE Serial Monitor and have something as shown in the following figure:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"708\" height=\"584\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/arduino_ide_serial_monitor_debug_messages.jpg?resize=708%2C584&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-77515\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/arduino_ide_serial_monitor_debug_messages.jpg?w=708&amp;quality=100&amp;strip=all&amp;ssl=1 708w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/arduino_ide_serial_monitor_debug_messages.jpg?resize=300%2C247&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 708px) 100vw, 708px\" \/><\/figure><\/div>\n\n\n<p>However, this doesn&#8217;t present colors.&nbsp;To make the messages more visible, we can assign different colors to each level of debug. ESP-IDF, Android studio and other development environments have this feature.<\/p>\n\n\n\n<p>That&#8217;s why I&#8217;ve developed a desktop app, the <a href=\"https:\/\/github.com\/JoaoLopesF\/SerialDebug\/tree\/master\/SerialDebugApp\" target=\"_blank\" rel=\"noopener noreferrer\">SerialDebugApp<\/a>. In this app, debug messages are displayed in color. For example, using the example in <a href=\"https:\/\/github.com\/JoaoLopesF\/SerialDebug\/tree\/master\/Examples\/SerialDebug_advanced\" target=\"_blank\" rel=\"noopener noreferrer\">SerialDebug Advanced<\/a> of SerialDebug library, we get something as follows when using the default debug level:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"707\" height=\"295\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/serialdebugapp_debug.png?resize=707%2C295&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-77516\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/serialdebugapp_debug.png?w=707&amp;quality=100&amp;strip=all&amp;ssl=1 707w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/serialdebugapp_debug.png?resize=300%2C125&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 707px) 100vw, 707px\" \/><\/figure><\/div>\n\n\n<p><span style=\"font-weight: 400;\">At the verbose level, we get the following:<\/span><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"706\" height=\"522\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/serialdebugapp_verbose.png?resize=706%2C522&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-77517\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/serialdebugapp_verbose.png?w=706&amp;quality=100&amp;strip=all&amp;ssl=1 706w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/serialdebugapp_verbose.png?resize=300%2C222&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 706px) 100vw, 706px\" \/><\/figure><\/div>\n\n\n<p><span style=\"font-weight: 400;\"><strong>Note<\/strong>: the level can be changed via the serial port (this feature is not even possible with ESP-IDF).<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Debugger<\/h2>\n\n\n\n<p>With the SerialDebug library, you can have a simple and functional software debugger. In the Serial Monitor and using SerialDebug library, you can:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Call a function<\/li>\n\n\n\n<li>Show and change values \u200b\u200bof global variables<\/li>\n\n\n\n<li>Add or change watches for global variables<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">SerialDebug Boards Compatibility<\/h3>\n\n\n\n<p>SerialDebug is compatible with any board supported by Arduino IDE. This library is optimized in speed and memory, and can be used in boards with low memory, like UNO with only 2k of RAM (without some features, due limit of hardware), up until modern boards, such as ESP32, Arduino MKRs, ARM MCU boards, as Teensy 3.x, with full features enabled.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Migrating Code to SerialDebug<\/h3>\n\n\n\n<p>Migrating the code to use SerialDebug is very simple. There is a <a href=\"https:\/\/github.com\/JoaoLopesF\/SerialDebugConverter\" target=\"_blank\" rel=\"noopener noreferrer\">converter<\/a> that reads existing Arduino code and generates a new directory with the code converted and ready to use.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"534\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/serialdebugconverter.png?resize=750%2C534&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-77523\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/serialdebugconverter.png?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/serialdebugconverter.png?resize=300%2C214&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\">Installing SerialDebug Library<\/h3>\n\n\n\n<p>Follow the next steps to install the SerialDebug library:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"https:\/\/github.com\/JoaoLopesF\/SerialDebug\/archive\/master.zip\" target=\"_blank\" rel=\"noopener noreferrer\">Click here to download the SerialDebug library<\/a><\/li>\n\n\n\n<li>You should have a <em>.zip<\/em> folder in your <em>Downloads<\/em> folder<\/li>\n\n\n\n<li>Unzip the <em>.z<\/em>ip folder and you should get <em>SerialDebug-master<\/em> folder<\/li>\n\n\n\n<li>Rename your folder from <del><em>SerialDebug-master<\/em><\/del> to <em>SerialDebug<\/em><\/li>\n\n\n\n<li>Move the <em>SerialDebug<\/em> folder to your Arduino IDE installation libraries folder<\/li>\n<\/ol>\n\n\n\n<p>Or use Library manager of Arduino IDE.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open Arduino IDE<\/li>\n\n\n\n<li>Go to <strong>Sketch<\/strong> &gt; <strong>Include library<\/strong> &gt; <strong>Manage libraries<\/strong><\/li>\n\n\n\n<li>Search for &#8220;<strong>SerialDebug<\/strong>&#8221; and click &#8220;Install&#8221;<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"271\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/install_serial_debuglibrary.png?resize=750%2C271&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-77519\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/install_serial_debuglibrary.png?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/install_serial_debuglibrary.png?resize=300%2C108&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">How to use SerialDebug &#8211; Basic Example<\/h2>\n\n\n\n<p>In the Arduino IDE, go to <strong>File<\/strong> &gt; <strong>Examples<\/strong> &gt; <strong>SerialDebug<\/strong> and select the <strong>SerialDebug_basic<\/strong> example.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"602\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/debug_basic_example.jpg?resize=750%2C602&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-77520\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/debug_basic_example.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/debug_basic_example.jpg?resize=300%2C241&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p>You should see the following code:<\/p>\n\n\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-c\">\/\/\/\/\/\/\/\/\n\/\/ Libraries Arduino\n\/\/\n\/\/ Library: SerialDebug - Improved serial debugging to Arduino, with simple software debugger\n\/\/ Author: Joao Lopes\n\/\/ GitHub: https:\/\/github.com\/JoaoLopesF\/SerialDebug\n\/\/\n\/\/ Basic example to show how to use it.\n\/\/\n\/\/ Example of use:\n\/\/\n\/\/   print macros:\n\/\/\n\/\/\t\tprintA(F(&quot;This is a always - var &quot;));\n\/\/\t\tprintlnA(var);\n\/\/\t\tprintV(F(&quot;This is a verbose - var &quot;));\n\/\/\t\tprintlnV(var);\n\/\/\t\tprintD(F(&quot;This is a debug - var &quot;));\n\/\/\t\tprintlnD(var);\n\/\/\t\tprintI(F(&quot;This is a information - var &quot;));\n\/\/\t\tprintlnI(var);\n\/\/\t\tprintW(F(&quot;This is a warning - var &quot;));\n\/\/\t\tprintlnW(var);\n\/\/\t\tprintE(F(&quot;This is a error - var &quot;));\n\/\/\t\tprintlnE(var);\n\/\/\n\/\/\t\tprintlnV(&quot;This not have args&quot;);\n\/\/\n\/\/\/\/\/\/\/\n\n\/\/\/\/\/\/ Includes\n\n#include &quot;Arduino.h&quot;\n\n\/\/ SerialDebug Library\n\n\/\/ Disable all debug ? Good to release builds (production)\n\/\/ as nothing of SerialDebug is compiled, zero overhead :-)\n\/\/ For it just uncomment the DEBUG_DISABLED\n\/\/#define DEBUG_DISABLED true\n\n\/\/ Define the initial debug level here (uncomment to do it)\n\/\/ #define DEBUG_INITIAL_LEVEL DEBUG_LEVEL_VERBOSE\n\n\/\/ Disable SerialDebug debugger ? No more commands and features as functions and globals\n\/\/ Uncomment this to disable it \n\/\/#define DEBUG_DISABLE_DEBUGGER true\n\n\/\/ Disable auto function name (good if your debug yet contains it)\n\/\/#define DEBUG_AUTO_FUNC_DISABLED true\n\n\/\/ Force debug messages to can use flash ) ?\n\/\/ Disable native Serial.printf (if have)\n\/\/ Good for low memory, due use flash, but more slow and not use macros\n\/\/#define DEBUG_USE_FLASH_F true\n\n\/\/ Include SerialDebug\n\n#include &quot;SerialDebug.h&quot; \/\/https:\/\/github.com\/JoaoLopesF\/SerialDebug\n\n\/\/\/\/\/\/ Variables\n\n\/\/ Time\n\nuint32_t mTimeSeconds = 0;\n\n\/\/ Buildin Led ON ?\n\nboolean mLedON = false;\n\n\/\/\/\/\/\/ Setup\n\nvoid setup() {\n\n    \/\/ Initialize the Serial\n\n    Serial.begin(115200); \/\/ Can change it to 230400, if you dont use debugIsr* macros\n\n#ifdef __AVR_ATmega32U4__ \/\/ Arduino AVR Leonardo\n\n    while (!Serial) {\n        ; \/\/ wait for serial port to connect. Needed for Leonardo only\n    }\n\n#else\n\n    delay(500); \/\/ Wait a time\n\n#endif\n\n  \t\/\/ Debug\n\n\t\/\/ Attention:\n    \/\/ SerialDebug starts disabled and it only is enabled if have data avaliable in Serial\n    \/\/ Good to reduce overheads.\n\t\/\/ if You want debug, just press any key and enter in monitor serial\n\n    \/\/ Note: all debug in setup must be debugA (always), due it is disabled now.\n\n    printlnA(F(&quot;**** Setup: initializing ...&quot;));\n\n    \/\/ Buildin led\n\n    pinMode(LED_BUILTIN, OUTPUT);\n    digitalWrite(LED_BUILTIN, LOW);\n\n    \/\/ WiFi connection, etc ....\n\n    \/\/ ...\n\n    \/\/ End\n\n    printlnA(F(&quot;*** Setup end&quot;));\n\n}\n\n\/\/\/\/\/\/ Loop\n\nvoid loop()\n{\n\t\/\/ SerialDebug handle\n\t\/\/ Notes: if in inactive mode (until receive anything from serial),\n\t\/\/ it show only messages of always or errors level type\n\t\/\/ And the overhead during inactive mode is very low\n\t\/\/ Only if not DEBUG_DISABLED\n\n\tdebugHandle();\n\n\t\/\/ Blink the led\n\n\tmLedON = !mLedON;\n\tdigitalWrite(LED_BUILTIN, (mLedON)?LOW:HIGH);\n\n\t\/\/ Debug the time (verbose level)\n\n\tprintV(F(&quot;Time: &quot;));\n\tprintV(mTimeSeconds);\n\tprintlnV(F(&quot; seconds (VERBOSE)&quot;));\n\n\tif (mTimeSeconds % 5 == 0) { \/\/ Each 5 seconds\n\n\t\t\/\/ Debug levels\n\n\t\tprintlnV(F(&quot;This is a message of debug level VERBOSE&quot;));\n\t\tprintlnD(F(&quot;This is a message of debug level DEBUG&quot;));\n\t\tprintlnI(F(&quot;This is a message of debug level INFO&quot;));\n\t\tprintlnW(F(&quot;This is a message of debug level WARNING&quot;));\n\t\tprintlnE(F(&quot;This is a message of debug level ERROR&quot;));\n\n\t\t\/\/ Functions example to show auto function name feature\n\n\t\tfoo();\n\n\t\tbar();\n\t}\n\n\t\/\/ Time\n\n\tmTimeSeconds++;\n\n\t\/\/ Delay of 1 second\n\n\tdelay(1000);\n}\n\n\n\/\/ Functions example to show auto function name feature\n\nvoid foo() {\n\n  uint8_t var = 1;\n\n  printV(F(&quot;This is a debug - var &quot;));\n  printlnV(var);\n}\n\nvoid bar() {\n\n  uint8_t var = 2;\n\n  printD(F(&quot;This is a debug - var &quot;));\n  printlnD(var);\n\n}\n\n\/\/\/\/\/\/\/\/\/\/\/ End\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/JoaoLopesF\/SerialDebug\/raw\/master\/Examples\/SerialDebug_basic\/SerialDebug_basic.ino\" target=\"_blank\">View raw code<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Explaining the Basic Example<\/h3>\n\n\n\n<p><strong>1.<\/strong> First, include the SerialDebug library:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#include \"SerialDebug.h\" \/\/ https:\/\/github.com\/JoaoLopesF\/SerialDebug<\/pre>\n\n\n\n<p>The SerialDebug library has several options that must be set before the &#8220;#include&#8221;. These are commented in the example, so that you can activate the options for your specific case:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ Disable all debug ? Good to release builds (production)\n\/\/ as nothing of SerialDebug is compiled, zero overhead :-)\n\/\/ For it just uncomment the DEBUG_DISABLED\n<strong>\/\/#define DEBUG_DISABLED true\n<\/strong>\n\/\/ Define the initial debug level here (uncomment to do it)\n<strong>\/\/ #define DEBUG_INITIAL_LEVEL DEBUG_LEVEL_VERBOSE\n<\/strong>\n\/\/ Disable SerialDebug debugger ? No more commands and features as functions and globals\n\/\/ Uncomment this to disable it \n<strong>\/\/#define DEBUG_DISABLE_DEBUGGER true\n<\/strong>\n\/\/ Disable auto function name (good if your debug yet contains it)\n<strong>\/\/#define DEBUG_AUTO_FUNC_DISABLED true\n<\/strong>\n\/\/ Force debug messages to can use flash ) ?\n\/\/ Disable native Serial.printf (if have)\n\/\/ Good for low memory, due use flash, but more slow and not use macros\n<strong>\/\/#define DEBUG_USE_FLASH_F true<\/strong><\/pre>\n\n\n\n<p>Here&#8217;s a brief explanation of each option:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>DEBUG_DISABLED<\/strong>: Disable the full library. With this option, nothing of SerialDebug will be compiled and debug outputs will not be generated. This is good to release a production version.<\/li>\n\n\n\n<li><strong>DEBUG_INITIAL_LEVEL<\/strong>: This is used to set initial level &#8211; the default is Debug level.<\/li>\n\n\n\n<li><strong>DEBUG_DISABLE_DEBUGGER<\/strong>: This disables the simple software debugger. This is good to reduce memory usage in low memory boards.<\/li>\n\n\n\n<li><strong>DEBUG_AUTO_FUNC_DISABLED<\/strong>: This disables the auto function name feature. This is good if your code already has that function in the debug messages.<\/li>\n<\/ul>\n\n\n\n<p><strong>2.<\/strong> For this example, no code is needed for SerialDebug in <em>setup()<\/em> function.<\/p>\n\n\n\n<p><strong>3.<\/strong> In the <em>loop()<\/em> function, we\u2019re using print macros to debug.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">printV(F(\"Time: \"));\nprintV(mTimeSeconds);\nprintlnV(F(\" seconds (VERBOSE)\"));\n\nif (mTimeSeconds % 5 == 0) { \/\/ Each 5 seconds\n&nbsp; \/\/ Debug levels\n\n&nbsp; printlnV(F(\"This is a message of debug level VERBOSE\"));\n&nbsp; printlnD(F(\"This is a message of debug level DEBUG\"));\n&nbsp; printlnI(F(\"This is a message of debug level INFO\"));\n&nbsp; printlnW(F(\"This is a message of debug level WARNING\"));\n&nbsp; printlnE(F(\"This is a message of debug level ERROR\"));\n\n&nbsp; \/\/ Functions example to show auto function name feature\n\n&nbsp; foo();\n\n&nbsp; bar();\n}<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Print macros<\/h4>\n\n\n\n<p>SerialDebug has several print macros to debug outputs:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>printV\/printlnV:<\/strong> message of level verbose.<\/li>\n\n\n\n<li><strong>printD\/printlnD:<\/strong> message of level debug<\/li>\n\n\n\n<li><strong>printI\/printlnI:<\/strong> message of level information<\/li>\n\n\n\n<li><strong>printW\/printlnW:<\/strong> message of level warning<\/li>\n\n\n\n<li><strong>printE\/printlnE:<\/strong> message of level error &#8211; always shown<\/li>\n\n\n\n<li><strong>printA\/printlnA:<\/strong> message of level always &#8211; always shown<\/li>\n<\/ul>\n\n\n\n<p>These macros are a replacement of standard <em>Serial.print<\/em> commands.<\/p>\n\n\n\n<p><strong>Note:<\/strong>&nbsp;all routines to show debug are a C\/C++ precompiler macros, so there is no need for extra functions calls, only <em>Serial.print<\/em> and <em>Serial.println<\/em> (except when use printf formatter for boards that don\u2019t have it native).<\/p>\n\n\n\n<p>Take the following code as an example:<\/p>\n\n\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-c\">\/\/ Example from ladyada.net\/learn\/arduino\/lesson4.html\n\nint a = 5;\nint b = 10;\nint c = 20;\n\nvoid setup()                    \/\/ run once, when the sketch starts\n{\n  Serial.begin(9600);           \/\/ set up Serial library at 9600 bps\n\n  Serial.println(&quot;Here is some math: &quot;);\n\n  Serial.print(&quot;a = &quot;);\n  Serial.println(a);\n  Serial.print(&quot;b = &quot;);\n  Serial.println(b);\n  Serial.print(&quot;c = &quot;);\n  Serial.println(c);\n\n  Serial.print(&quot;a + b = &quot;);       \/\/ add\n  Serial.println(a + b);\n\n  Serial.print(&quot;a * c = &quot;);       \/\/ multiply\n  Serial.println(a * c);\n  \n  Serial.print(&quot;c \/ b = &quot;);       \/\/ divide\n  Serial.println(c \/ b);\n  \n  Serial.print(&quot;b - c = &quot;);       \/\/ subtract\n  Serial.println(b - c);\n}\n\nvoid loop()                     \/\/ we need this to be here even though its empty\n{\n}\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/Random-Nerd-Tutorials\/raw\/master\/Projects\/SerialDebug\/Example.ino\" target=\"_blank\">View raw code<\/a><\/p>\n\n\n\n<p>This code is migrated to SerialDebug by making the following changes:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>replace <em>Serial.println<\/em> to <em>printlnD<\/em><\/li>\n\n\n\n<li>replace <em>Serial.print<\/em> to <em>printD<\/em><\/li>\n<\/ul>\n\n\n\n<p>D refers to debug level. Instead of D, you can use V to verbose.<\/p>\n\n\n\n<p>As mentioned previously, SerialDebug has a converter to help you migrate Arduino codes from Serial.prints to this library. We recommend using the converter to avoid unnecessary errors. Take a look at the SerialDebugConverter on the following link:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/github.com\/JoaoLopesF\/SerialDebugConverter\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/github.com\/JoaoLopesF\/SerialDebugConverter<\/a><\/li>\n<\/ul>\n\n\n\n<p>After running the code on the converter, a new file is generated on the source code folder. If you try the previous example, you&#8217;ll get the following:<\/p>\n\n\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-c\">\/\/ Example from ladyada.net\/learn\/arduino\/lesson4.html\n\nint a = 5;\nint b = 10;\nint c = 20;\n\n\/\/ SerialDebug Library\n\n\/\/ Disable all debug ? Good to release builds (production)\n\/\/ as nothing of SerialDebug is compiled, zero overhead :-)\n\/\/ For it just uncomment the DEBUG_DISABLED\n\/\/#define DEBUG_DISABLED true\n\n\/\/ Disable SerialDebug debugger ? No more commands and features as functions and globals\n\/\/ Uncomment this to disable it \n\/\/#define DEBUG_DISABLE_DEBUGGER true\n\n\/\/ Define the initial debug level here (uncomment to do it)\n\/\/#define DEBUG_INITIAL_LEVEL DEBUG_LEVEL_VERBOSE\n\n\/\/ Disable auto function name (good if your debug yet contains it)\n\/\/#define DEBUG_AUTO_FUNC_DISABLED true\n\n\/\/ Include SerialDebug\n#include &quot;SerialDebug.h&quot; \/\/ Download SerialDebug library: https:\/\/github.com\/JoaoLopesF\/SerialDebug\n\nvoid setup()                    \/\/ run once, when the sketch starts\n{\n  Serial.begin(9600);           \/\/ set up Serial library at 9600 bps\n\n  printlnA(&quot;Here is some math: &quot;);\n\n  printA(&quot;a = &quot;);\n  printlnA(a);\n  printA(&quot;b = &quot;);\n  printlnA(b);\n  printA(&quot;c = &quot;);\n  printlnA(c);\n\n  printA(&quot;a + b = &quot;);       \/\/ add\n  printlnA(a + b);\n\n  printA(&quot;a * c = &quot;);       \/\/ multiply\n  printlnA(a * c);\n  \n  printA(&quot;c \/ b = &quot;);       \/\/ divide\n  printlnA(c \/ b);\n  \n  printA(&quot;b - c = &quot;);       \/\/ subtract\n  printlnA(b - c);\n\n#ifndef DEBUG_DISABLE_DEBUGGER\n\n  \/\/ Add Functions and global variables to SerialDebug\n\n  \/\/ Add functions that can called from SerialDebug\n\n  \/\/debugAddFunctionVoid(F(&quot;function&quot;), &amp;function); \/\/ Example for function without args\n  \/\/debugAddFunctionStr(F(&quot;function&quot;), &amp;function); \/\/ Example for function with one String arg\n  \/\/debugAddFunctionInt(F(&quot;function&quot;), &amp;function); \/\/ Example for function with one int arg\n\n  \/\/ Add global variables that can showed\/changed from SerialDebug\n  \/\/ Note: Only global, if pass local for SerialDebug, can be dangerous\n\n  debugAddGlobalInt(F(&quot;a&quot;), &amp;a);\n  debugAddGlobalInt(F(&quot;b&quot;), &amp;b);\n  debugAddGlobalInt(F(&quot;c&quot;), &amp;c);\n\n#endif \/\/ DEBUG_DISABLE_DEBUGGER\n\n}\n\nvoid loop()                     \/\/ we need this to be here even though its empty\n{\n\n  \/\/ SerialDebug handle\n  \/\/ Notes: if in inactive mode (until receive anything from serial),\n  \/\/ it show only messages of always or errors level type\n  \/\/ And the overhead during inactive mode is very low\n  \/\/ Only if not DEBUG_DISABLED\n\n  debugHandle();\n\n}\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/Random-Nerd-Tutorials\/raw\/master\/Projects\/SerialDebug\/SerialDebug_Example_dbg.ino\" target=\"_blank\">View raw code<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Debug macros<\/h3>\n\n\n\n<p>SerialDebug has 3 types of debug macros:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>print?<\/strong> &#8211; Serial.print replacement<\/li>\n\n\n\n<li><strong>println?<\/strong> &#8211; Serial.println replacement<\/li>\n\n\n\n<li><strong>debug?<\/strong> &#8211; Serial.printf (with newline) replacement<\/li>\n<\/ul>\n\n\n\n<p>The sufix &#8220;?&#8221; is the message level, for example: printV, printlnD, debugE.<\/p>\n\n\n\n<p>Here&#8217;s an example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">printD(\"b - c = \"); \/\/ subtract\nprintlnD(b - c);<\/pre>\n\n\n\n<p>Which generates the following output in serial monitor:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">V p:^1000 loop C1) b - c = 2<\/pre>\n\n\n\n<p>Where:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>V:<\/strong> is the level<\/li>\n\n\n\n<li><strong>p:<\/strong> is a profile elapsed time between this and previous debug<\/li>\n\n\n\n<li><strong>loop:<\/strong> is the function name where this debug message was triggered<\/li>\n\n\n\n<li><strong>C1:<\/strong> is the core that executed this debug message (only applies to the ESP32)<\/li>\n\n\n\n<li>The remaining is the message<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Uploading the basic example<\/h2>\n\n\n\n<p>Upload the SerialDebug_basic example:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"562\" height=\"680\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/upload-serial-debug-simple-example.png?resize=562%2C680&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-77525\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/upload-serial-debug-simple-example.png?w=562&amp;quality=100&amp;strip=all&amp;ssl=1 562w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/upload-serial-debug-simple-example.png?resize=248%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 248w\" sizes=\"(max-width: 562px) 100vw, 562px\" \/><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\">Using the SerialDebug in the Arduino IDE Serial Monitor<\/h3>\n\n\n\n<p>Open the Serial Monitor.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"708\" height=\"197\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/serial_monitor_inactive.png?resize=708%2C197&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-77526\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/serial_monitor_inactive.png?w=708&amp;quality=100&amp;strip=all&amp;ssl=1 708w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/serial_monitor_inactive.png?resize=300%2C83&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 708px) 100vw, 708px\" \/><\/figure><\/div>\n\n\n<p>The initial status of SerialDebug is inactive, where there isn\u2019t normal debug outputs, and no CPU waste time for debugs. This is good for projects that are not always connected via USB (battery powered or external power supply, for example). The only messages that are processed and displayed are of type Error or Always (important ones).<\/p>\n\n\n\n<p>After receiving the first command, SerialDebug becomes active:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"708\" height=\"294\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/serial_monitor_default_level.png?resize=708%2C294&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-77527\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/serial_monitor_default_level.png?w=708&amp;quality=100&amp;strip=all&amp;ssl=1 708w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/serial_monitor_default_level.png?resize=300%2C125&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 708px) 100vw, 708px\" \/><\/figure><\/div>\n\n\n<p>The default level is Debug, but it can be changed. Note that the messages of level verbose are not being shown.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">SerialDebug commands<\/h3>\n\n\n\n<p>SerialDebug has commands that can be executed by the Serial Monitor. For example:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>?<\/strong> &#8211; show help of commands<\/li>\n\n\n\n<li><strong>v<\/strong> &#8211; change level to verbose<\/li>\n<\/ul>\n\n\n\n<p>If you type <strong>?<\/strong> and press &#8220;Send&#8221;, it shows help commands:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"707\" height=\"779\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/serial_monitor_help.png?resize=707%2C779&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-77528\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/serial_monitor_help.png?w=707&amp;quality=100&amp;strip=all&amp;ssl=1 707w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/serial_monitor_help.png?resize=272%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 272w\" sizes=\"(max-width: 707px) 100vw, 707px\" \/><\/figure><\/div>\n\n\n<p>If you want to change level to verbose (command <strong>v<\/strong> and &#8220;Send&#8221; button):<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"708\" height=\"400\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/serial_monitor_verbose_level_f.png?resize=708%2C400&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-77529\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/serial_monitor_verbose_level_f.png?w=708&amp;quality=100&amp;strip=all&amp;ssl=1 708w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/serial_monitor_verbose_level_f.png?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 708px) 100vw, 708px\" \/><\/figure><\/div>\n\n\n<p>Note that the volume of messages displayed increases significantly. That\u2019s why having different debug levels is important.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Video Demonstration<\/h2>\n\n\n\n<p>You can watch the following video about the SerialDebug library to see it in action:<\/p>\n\n\n<p style=\"text-align:center\"><iframe width=\"720\" height=\"405\" src=\"https:\/\/www.youtube.com\/embed\/EfvF55Ww-lU?rel=0\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Wrapping Up<\/h2>\n\n\n\n<p>This first article was an introduction to the SerialDebug library for Arduino IDE. With this library we can significantly improve the debugging for Arduino IDE. We\u2019ve also shown you how to use debug levels with the library and how to interact with the Serial Monitor.<\/p>\n\n\n\n<p>In <a href=\"https:\/\/randomnerdtutorials.com\/software-debugger-arduino-ide-serialdebug-library\/\">part 2<\/a>, you&#8217;ll discover SerialDebug library advanced features, such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>simple software debugger &#8211; how to get it without hardware debugger<\/li>\n\n\n\n<li>debug? macros &#8211; using the powerful printf to format<\/li>\n<\/ul>\n\n\n\n<p><strong>Continue Reading<\/strong>: <a href=\"https:\/\/randomnerdtutorials.com\/software-debugger-arduino-ide-serialdebug-library\/\">Better Debugging for Arduino IDE using Software Debugger (Part 2)<\/a><\/p>\n\n\n\n<p>Help me bring a better debug to the Arduino IDE using this library. Visit the GitHub page <a href=\"https:\/\/github.com\/JoaoLopesF\/SerialDebug\">https:\/\/github.com\/JoaoLopesF\/SerialDebug<\/a>, for more information, post issues and suggestions. Also, you can use the <a href=\"https:\/\/gitter.im\/SerialDebug\/Public\" target=\"_blank\" rel=\"noopener noreferrer\">gitter chat room<\/a> to share your feedback.<\/p>\n\n\n\n<p>Thanks to Random Nerd Tutorials for the possibility of doing a post about SerialDebug library.<\/p>\n\n\n\n<p>Jo\u00e3o Lopes<\/p>\n\n\n\n<p><em>Random Nerd Tutorials has more than 200 free electronics projects and tutorials. Check them all in the next link:&nbsp;<\/em><a href=\"https:\/\/randomnerdtutorials.com\/projects\/\" target=\"_blank\" rel=\"noopener noreferrer\">200+ Electronics Projects and Tutorials<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The SerialDebug library allows you to improve and do better debugging in Arduino IDE. In this post, Jo\u00e3o Lopes (creator of the\u00a0SerialDebug library) shows you how use it in your projects. <\/p>\n<p class=\"read-more-container\"><a href=\"https:\/\/randomnerdtutorials.com\/serialdebug-library-arduino-ide\/\" class=\"read-more button\">CONTINUE READING \u00bb<\/a><\/p>\n","protected":false},"author":5,"featured_media":77567,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2,245,299,269,230,264],"tags":[],"class_list":["post-77510","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino","category-arduino-ide","category-0-esp32","category-guide-project","category-guide","category-project"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/11\/Serial-debug-arduino-ide.jpg?fit=1280%2C720&quality=100&strip=all&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/77510","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/comments?post=77510"}],"version-history":[{"count":4,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/77510\/revisions"}],"predecessor-version":[{"id":134554,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/77510\/revisions\/134554"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media\/77567"}],"wp:attachment":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media?parent=77510"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/categories?post=77510"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/tags?post=77510"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}