2020-11-27 05:33:55 -05:00
|
|
|
//
|
|
|
|
// FILE: XMLWriterPrint_2.ino
|
|
|
|
// AUTHOR: Rob Tillaart
|
2021-11-11 14:36:58 -05:00
|
|
|
// VERSION: 0.1.1
|
|
|
|
// PURPOSE: demo Print interface - use it to print "unsupported" and Printable data types
|
2020-11-27 05:33:55 -05:00
|
|
|
// DATE: 2020-07-07
|
|
|
|
// URL: https://github.com/RobTillaart/XMLWriter
|
|
|
|
//
|
|
|
|
|
2021-11-11 14:36:58 -05:00
|
|
|
|
2020-11-27 05:33:55 -05:00
|
|
|
#include <XMLWriter.h>
|
|
|
|
#include <printHelpers.h> // https://github.com/RobTillaart/printHelpers
|
|
|
|
|
|
|
|
XMLWriter XML(&Serial);
|
|
|
|
|
|
|
|
uint64_t big = 112233445566778899;
|
|
|
|
double large = 5.46372819E30;
|
|
|
|
|
|
|
|
char buffer[24];
|
|
|
|
|
2021-11-11 14:36:58 -05:00
|
|
|
|
2020-11-27 05:33:55 -05:00
|
|
|
void setup()
|
|
|
|
{
|
|
|
|
Serial.begin(115200);
|
|
|
|
|
|
|
|
XML.setConfig(XMLWRITER_COMMENT | XMLWRITER_INDENT);
|
|
|
|
XML.header();
|
|
|
|
XML.comment("XMLWriter Print interface - to inject not supported datatypes");
|
|
|
|
XML.tagOpen("unprintable");
|
|
|
|
XML.tagOpen("uint64_t ");
|
|
|
|
XML.indent();
|
|
|
|
XML.println(print64(big));
|
|
|
|
XML.tagClose();
|
|
|
|
XML.tagOpen("scientific");
|
|
|
|
XML.indent();
|
|
|
|
XML.println(sci(large, 6));
|
|
|
|
XML.tagClose();
|
|
|
|
XML.tagClose();
|
|
|
|
|
|
|
|
XML.flush();
|
|
|
|
}
|
|
|
|
|
2021-11-11 14:36:58 -05:00
|
|
|
|
2020-11-27 05:33:55 -05:00
|
|
|
void loop()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-11-11 14:36:58 -05:00
|
|
|
|
2020-11-27 05:33:55 -05:00
|
|
|
// -- END OF FILE --
|
2021-11-11 14:36:58 -05:00
|
|
|
|