Skip to content

Commit 390cc31

Browse files
committed
Added documnetation in Readme.md
1 parent 5389565 commit 390cc31

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,41 @@ If desired timestamps can be prefixed to the debug message. Timestamp output can
2727

2828
# How-To-Use Advanced
2929
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+
### 1. Debug :
33+
Arduino_DebugUtils Object that will be used for calling member functions.
34+
35+
### 2. 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+
Return type: void.
38+
Example:
39+
```
40+
Debug.setDebugLevel(DBG_VERBOSE);
41+
```
42+
43+
### 2. Debug.setDebugOutputStream(Stream * stream) :
44+
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.
45+
Example:
46+
```
47+
SoftwareSerial mySerial(10, 11); // RX, TX
48+
...
49+
Debug.setDebugOutputStream(&mySerial);
50+
```
51+
52+
### 3. Debug.timestampOn() :
53+
Calling this function will switches on the timestamp in `Debug.print()` function call;
54+
By default, printing timestamp is off, unless turned on using this function call.
55+
56+
### 4. Debug.timestampOff() :
57+
Calling this function will switches off the timestamp in `Debug.print()` function call;
58+
59+
### 5. Debug.print(int const debug_level, const char * fmt, ...);
60+
This function assess the debug_level and prints the message if parameter `debug_level` in `Debug.print(debug_level, ...)` function call belongs to the range: DBG_ERROR <= debug_level <= (<DBG_LEVEL> that has been set using setDebugLevel() function).
61+
Example:
62+
```
63+
Debug.setDebugLevel(DBG_VERBOSE);
64+
int i = 0;
65+
Debug.print(DBG_VERBOSE, "DBG_VERBOSE i = %d", i);
66+
67+
```

0 commit comments

Comments
 (0)