GY-63_MS5611/libraries/PrintString/examples/printString/printString.ino
2021-12-24 14:47:57 +01:00

56 lines
982 B
C++

//
// FILE: printString.ino
// AUTHOR: Rob Tillaart
// PURPOSE: demo experimental
// URL: https://github.com/RobTillaart/PrintString
#include "PrintString.h"
#include "XMLWriter.h" // https://github.com/RobTillaart/XMLWriter
PrintString ps;
XMLWriter XML(&ps);
void setup()
{
Serial.begin(115200);
Serial.println(__FILE__);
ps.println("Hello World");
ps.println(3.14159265, 4);
Serial.println(ps.getString());
ps.clear();
ps.println(3.14159265, 4);
ps.println("Hello World");
Serial.println(ps.getString());
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();
XML.flush();
Serial.println(ps.getString());
Serial.println("done...");
}
void loop()
{
}
// -- END OF FILE --