Files
ArduinoJson/examples/IndentedPrintExample/IndentedPrintExample.ino

30 lines
654 B
Arduino
Raw Normal View History

2014-08-26 12:48:59 +02:00
/*
* Arduino JSON library - IndentedPrint example
* Benoit Blanchon 2014 - MIT License
*/
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
2014-08-26 12:48:59 +02:00
}