50 lines
900 B
Arduino
Raw Normal View History

2020-11-27 11:33:55 +01:00
//
// FILE: XMLWriterPrint_3.ino
// AUTHOR: Rob Tillaart
2021-11-11 20:36:58 +01:00
// VERSION: 0.1.1
// PURPOSE: demo Print interface - Printable data types
2020-11-27 11:33:55 +01:00
// DATE: 2020-07-07
// URL: https://github.com/RobTillaart/XMLWriter
//
// example works for UNO but does not compile for ESP,
// to investigate [complex vs Complex]
2021-11-11 20:36:58 +01:00
2020-11-27 11:33:55 +01: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 20:36:58 +01:00
2020-11-27 11:33:55 +01: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 20:36:58 +01:00
2020-11-27 11:33:55 +01:00
void loop()
{
}
2021-11-11 20:36:58 +01:00
2020-11-27 11:33:55 +01:00
// -- END OF FILE --