Skip to content

Commit 31cd0e2

Browse files
committed
Adding minimal README
1 parent a35fbd4 commit 31cd0e2

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
ArduinoDebugUtils
2+
=================
3+
4+
This class provides functionality useful for debugging sketches via `printf`-style statements.
5+
6+
# How-To-Use Basic
7+
ArduinoDebugUtils has 6 different debug levels (described descending from highest to lowest priority):
8+
* `DebugLevel::None` - no debug output is shown
9+
* `DebugLevel::Error` - critical errors
10+
* `DebugLevel::Warning` - non-critical errors
11+
* `DebugLevel::Info` - information
12+
* `DebugLevel::Debug` - more information
13+
* `DebugLevel::Verbose` - most information
14+
15+
The desired debug level can be set via `setDebugLevel(DebugLevel::Warning)`.
16+
17+
Debug messages are written via `debugPrint` which supports `printf`-style formatted output.
18+
19+
Example:
20+
```C++
21+
int i = 1;
22+
float pi = 3.1459;
23+
ArduinoDebugUtils.debugPrint(DebugLevel::Verbose, "i = %d, pi = %f, i, pi);
24+
```
25+
26+
If desired timestamps can be prefixed to the debug message. Timestamp output can be enabled and disabled via `timestampOn` and `timestampOff`.
27+
28+
# How-To-Use Advanced
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)`.

0 commit comments

Comments
 (0)