GY-63_MS5611/libraries/PrintCharArray/examples/printCharArray3/printCharArray3.ino

51 lines
952 B
Arduino
Raw Normal View History

2017-12-09 14:39:12 -05:00
//
// FILE: printCharArray3.ino
// AUTHOR: Rob Tillaart
2020-11-27 05:28:57 -05:00
// VERSION: 0.1.1
// PURPOSE: demo with XML writer
// URL: https://github.com/RobTillaart/PrintCharArray
2017-12-09 14:39:12 -05:00
//
// HISTORY:
2020-11-27 05:28:57 -05:00
// 0.1.0 2017-12-09 initial version
// 0.1.1 2020-04-30 minor refactor
2017-12-09 14:39:12 -05:00
//
#include "PrintCharArray.h"
2020-11-27 05:28:57 -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);
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());
Serial.println(ps.free());
}
void loop()
{
}
2020-11-27 05:28:57 -05:00
// -- END OF FILE --