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

49 lines
884 B
Arduino
Raw Normal View History

2020-11-27 05:33:55 -05:00
//
// FILE: XMLWriterPrint_3.ino
// AUTHOR: Rob Tillaart
2021-11-11 14:36:58 -05:00
// PURPOSE: demo Print interface - Printable data types
2020-11-27 05:33:55 -05:00
// DATE: 2020-07-07
// URL: https://github.com/RobTillaart/XMLWriter
//
2021-12-29 10:27:03 -05:00
// example works for UNO but does not compile for ESP,
// to investigate [complex vs Complex]
2020-11-27 05:33:55 -05:00
2021-11-11 14:36:58 -05:00
2020-11-27 05:33:55 -05:00
#include <XMLWriter.h>
#include <Complex.h> // https://github.com/RobTillaart/Complex
XMLWriter XML(&Serial);
Complex c(3, 5);
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 - Printable interface");
XML.tagOpen("P");
XML.tagOpen("Complex");
XML.indent();
XML.println(c);
XML.tagClose();
XML.tagOpen("Complex");
XML.indent();
XML.println(c.c_sqrt());
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-12-29 10:27:03 -05:00