You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+59
Original file line number
Diff line number
Diff line change
@@ -27,3 +27,62 @@ If desired timestamps can be prefixed to the debug message. Timestamp output can
27
27
28
28
# How-To-Use Advanced
29
29
Normally all debug output is redirected to the primary serial output of each board (`Serial`). In case you want to redirect the output to another output stream you can make use of `setDebugOutputStream(&Serial2)`.
30
+
31
+
# Documentation
32
+
### Debug :
33
+
Arduino_DebugUtils Object that will be used for calling member functions.
34
+
35
+
### Debug.setDebugLevel(int const debug_level) :
36
+
Parameter debug_level in order of lowest to highest priority are : `DBG_NONE`, `DBG_ERROR`, `DBG_WARNING`, `DBG_INFO` (default), `DBG_DEBUG`, and `DBG_VERBOSE`.
37
+
38
+
Return type: void.
39
+
40
+
Example:
41
+
```
42
+
Debug.setDebugLevel(DBG_VERBOSE);
43
+
```
44
+
### Debug.setDebugOutputStream(Stream * stream) :
45
+
By default, Output Stream is Serial. In advanced cases other objects could be other serial ports (if available), or can be a Software Serial object.
46
+
47
+
Return type: void.
48
+
49
+
Example:
50
+
```
51
+
SoftwareSerial mySerial(10, 11); // RX, TX
52
+
Debug.setDebugOutputStream(&mySerial);
53
+
```
54
+
### Debug.timestampOn() :
55
+
Calling this function switches on the timestamp in the `Debug.print()` function call;
56
+
By default, printing timestamp is off, unless turned on using this function call.
57
+
58
+
Return type: void.
59
+
60
+
Example:
61
+
```
62
+
Debug.timestampOn();
63
+
Debug.print(DBG_VERBOSE, "i = %d", i); //Output looks like : [ 21007 ] i = 21
64
+
```
65
+
66
+
### Debug.timestampOff() :
67
+
Calling this function switches off the timestamp in the `Debug.print()` function call;
68
+
69
+
Return type: void.
70
+
71
+
Example:
72
+
```
73
+
Debug.timestampOff();
74
+
Debug.print(DBG_VERBOSE, "i = %d", i); //Output looks like : i = 21
This function prints the message if parameter `debug_level` in the `Debug.print(debug_level, ...)` function call belongs to the range: DBG_ERROR <= debug_level <= (<DBG_LEVEL> that has been set using `setDebugLevel()` function).
80
+
81
+
Return type: void.
82
+
83
+
Example:
84
+
```
85
+
Debug.setDebugLevel(DBG_VERBOSE);
86
+
int i = 0;
87
+
Debug.print(DBG_VERBOSE, "DBG_VERBOSE i = %d", i);
0 commit comments