mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
47 lines
747 B
Arduino
47 lines
747 B
Arduino
|
//
|
||
|
// FILE: printCharArray3.ino
|
||
|
// AUTHOR: Rob Tillaart
|
||
|
// VERSION: 0.1.0
|
||
|
// PURPOSE: demo
|
||
|
//
|
||
|
// HISTORY:
|
||
|
// 0.1.0 2017-12-09 initial version
|
||
|
//
|
||
|
|
||
|
#include "PrintCharArray.h"
|
||
|
|
||
|
#include "XMLWriter.h"
|
||
|
|
||
|
PrintCharArray ps;
|
||
|
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();
|
||
|
|
||
|
// write the XML generated in one call
|
||
|
Serial.println(ps.getBuffer());
|
||
|
Serial.println(ps.free());
|
||
|
|
||
|
}
|
||
|
|
||
|
void loop()
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|