Files
ArduinoJson/examples/IndentedPrintExample/IndentedPrintExample.ino

32 lines
689 B
Arduino
Raw Permalink Normal View History

2015-08-20 15:15:59 +02:00
// Copyright Benoit Blanchon 2014-2015
// MIT License
//
// Arduino JSON library
// https://github.com/bblanchon/ArduinoJson
2014-08-26 12:48:59 +02:00
2014-11-03 21:29:55 +01:00
#include <ArduinoJson.h>
2014-08-26 12:48:59 +02:00
2014-11-03 21:29:55 +01:00
using namespace ArduinoJson::Internals;
2014-08-26 12:48:59 +02:00
2014-11-03 21:29:55 +01:00
void setup() {
Serial.begin(9600);
IndentedPrint serial(Serial);
serial.setTabSize(4);
2014-08-26 12:48:59 +02:00
2014-11-03 21:29:55 +01:00
serial.println("This is at indentation 0");
serial.indent();
serial.println("This is at indentation 1");
serial.println("This is also at indentation 1");
serial.indent();
serial.println("This is at indentation 2");
serial.unindent();
serial.unindent();
serial.println("This is back at indentation 0");
}
2014-08-26 12:48:59 +02:00
2014-11-03 21:29:55 +01:00
void loop() {
// not used in this example
2015-08-20 15:15:59 +02:00
}