IndentedPrintExample.ino 654 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Arduino JSON library - IndentedPrint example
  3. * Benoit Blanchon 2014 - MIT License
  4. */
  5. #include <ArduinoJson.h>
  6. using namespace ArduinoJson::Internals;
  7. void setup() {
  8. Serial.begin(9600);
  9. IndentedPrint serial(Serial);
  10. serial.setTabSize(4);
  11. serial.println("This is at indentation 0");
  12. serial.indent();
  13. serial.println("This is at indentation 1");
  14. serial.println("This is also at indentation 1");
  15. serial.indent();
  16. serial.println("This is at indentation 2");
  17. serial.unindent();
  18. serial.unindent();
  19. serial.println("This is back at indentation 0");
  20. }
  21. void loop() {
  22. // not used in this example
  23. }