GY-63_MS5611/libraries/XMLWriter/examples/XMLWriterPrint_2/XMLWriterPrint_2.ino

46 lines
939 B
Arduino
Raw Normal View History

2020-11-27 05:33:55 -05:00
//
// FILE: XMLWriterPrint_2.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.0
// PURPOSE: demo Print interface - use it to print "unsupported" and Printable datatypes
// DATE: 2020-07-07
// URL: https://github.com/RobTillaart/XMLWriter
//
#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];
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();
}
void loop()
{
}
// -- END OF FILE --