2017-12-09 14:39:12 -05:00
|
|
|
//
|
|
|
|
// FILE: printCharArray3.ino
|
|
|
|
// AUTHOR: Rob Tillaart
|
2020-11-27 05:28:57 -05:00
|
|
|
// PURPOSE: demo with XML writer
|
|
|
|
// URL: https://github.com/RobTillaart/PrintCharArray
|
2021-11-13 10:35:33 -05:00
|
|
|
|
2017-12-09 14:39:12 -05:00
|
|
|
|
|
|
|
#include "PrintCharArray.h"
|
|
|
|
|
2021-11-13 10:35:33 -05:00
|
|
|
#include "XMLWriter.h" // https://github.com/RobTillaart/XMLWriter
|
2017-12-09 14:39:12 -05:00
|
|
|
|
2020-11-27 05:28:57 -05:00
|
|
|
PrintCharArray ps(250);
|
2017-12-09 14:39:12 -05:00
|
|
|
XMLWriter XML(&ps);
|
|
|
|
|
2021-11-13 10:35:33 -05:00
|
|
|
|
2017-12-09 14:39:12 -05:00
|
|
|
void setup()
|
|
|
|
{
|
|
|
|
Serial.begin(115200);
|
|
|
|
Serial.println(__FILE__);
|
|
|
|
|
|
|
|
ps.clear();
|
|
|
|
|
|
|
|
XML.header();
|
|
|
|
XML.comment("Weather in Nebraska");
|
|
|
|
XML.tagOpen("Data");
|
|
|
|
XML.writeNode("Date", "20131106");
|
|
|
|
XML.writeNode("Time", "11:42");
|
|
|
|
XML.writeNode("Temp", "23.4");
|
|
|
|
XML.writeNode("Humi", "50%");
|
|
|
|
XML.writeNode("Rain", "10mm");
|
|
|
|
XML.writeNode("Sun", "40");
|
|
|
|
XML.tagClose();
|
2020-11-27 05:28:57 -05:00
|
|
|
XML.flush();
|
2017-12-09 14:39:12 -05:00
|
|
|
|
|
|
|
// write the XML generated in one call
|
|
|
|
Serial.println(ps.getBuffer());
|
2021-01-29 06:31:58 -05:00
|
|
|
Serial.println(ps.available());
|
2017-12-09 14:39:12 -05:00
|
|
|
}
|
|
|
|
|
2021-11-13 10:35:33 -05:00
|
|
|
|
2017-12-09 14:39:12 -05:00
|
|
|
void loop()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-11-13 10:35:33 -05:00
|
|
|
|
2020-11-27 05:28:57 -05:00
|
|
|
// -- END OF FILE --
|
2021-11-13 10:35:33 -05:00
|
|
|
|