GY-63_MS5611/libraries/PrintString/examples/printString/printString.ino

56 lines
982 B
Arduino
Raw Normal View History

2017-12-09 19:35:48 -05:00
//
// FILE: printString.ino
// AUTHOR: Rob Tillaart
// PURPOSE: demo experimental
2020-11-27 05:28:57 -05:00
// URL: https://github.com/RobTillaart/PrintString
2017-12-09 19:35:48 -05:00
2021-11-14 11:19:48 -05:00
2017-12-09 19:35:48 -05:00
#include "PrintString.h"
2021-01-29 06:31:58 -05:00
#include "XMLWriter.h" // https://github.com/RobTillaart/XMLWriter
2017-12-09 19:35:48 -05:00
PrintString ps;
XMLWriter XML(&ps);
2021-11-14 11:19:48 -05:00
2017-12-09 19:35:48 -05:00
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();
2020-11-27 05:28:57 -05:00
XML.flush();
2017-12-09 19:35:48 -05:00
Serial.println(ps.getString());
Serial.println("done...");
}
2021-11-14 11:19:48 -05:00
2017-12-09 19:35:48 -05:00
void loop()
{
}
2020-11-27 05:28:57 -05:00
2021-11-14 11:19:48 -05:00
2020-11-27 05:28:57 -05:00
// -- END OF FILE --
2021-11-14 11:19:48 -05:00