Line | |
---|
1 | // Copyright Benoit Blanchon 2014-2016
|
---|
2 | // MIT License
|
---|
3 | //
|
---|
4 | // Arduino JSON library
|
---|
5 | // https://github.com/bblanchon/ArduinoJson
|
---|
6 | // If you like this project, please add a star!
|
---|
7 |
|
---|
8 | #include <ArduinoJson.h>
|
---|
9 |
|
---|
10 | using namespace ArduinoJson::Internals;
|
---|
11 |
|
---|
12 | void setup() {
|
---|
13 | Serial.begin(9600);
|
---|
14 | while (!Serial) {
|
---|
15 | // wait serial port initialization
|
---|
16 | }
|
---|
17 |
|
---|
18 | IndentedPrint serial(Serial);
|
---|
19 | serial.setTabSize(4);
|
---|
20 |
|
---|
21 | serial.println("This is at indentation 0");
|
---|
22 | serial.indent();
|
---|
23 | serial.println("This is at indentation 1");
|
---|
24 | serial.println("This is also at indentation 1");
|
---|
25 | serial.indent();
|
---|
26 | serial.println("This is at indentation 2");
|
---|
27 |
|
---|
28 | serial.unindent();
|
---|
29 | serial.unindent();
|
---|
30 | serial.println("This is back at indentation 0");
|
---|
31 | }
|
---|
32 |
|
---|
33 | void loop() {
|
---|
34 | // not used in this example
|
---|
35 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.