From 8e6e718d060f20aa7bbded78d3a5e5af3c5f9975 Mon Sep 17 00:00:00 2001 From: lozziboy Date: Thu, 14 Sep 2023 15:37:04 +0200 Subject: [PATCH] Add files via upload --- examples/Example1/Example1.ino | 30 +++++++++++++++++++++++++++ examples/Example2/Example2.ino | 38 ++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 examples/Example1/Example1.ino create mode 100644 examples/Example2/Example2.ino diff --git a/examples/Example1/Example1.ino b/examples/Example1/Example1.ino new file mode 100644 index 0000000..ccad806 --- /dev/null +++ b/examples/Example1/Example1.ino @@ -0,0 +1,30 @@ + +/* +a fast lightweight real time library to monitor and modify arduino variables via serial usb +this library is compatible with arduino unoR3, unoR4, Mega, and shields based on esp8266, esp32 +https://github.com/lozziboy/arduino-serial-variable-table +*/ + +// include cSerialWatcher class +#include "cSerialWatcher.h" + +// create SerialWatcher instance +cSerialWatcher SerialWatcher(Serial); + +// create global variables +int u = 15; +bool v = true; + +void setup() { + Serial.begin(115200); // init serial communication +} + +void loop() { + + // map variables + SerialWatcher.Map(F("u"), u); + SerialWatcher.Map(F("v"), v); + + // update watch stream + SerialWatcher.Update(); +} diff --git a/examples/Example2/Example2.ino b/examples/Example2/Example2.ino new file mode 100644 index 0000000..22639e8 --- /dev/null +++ b/examples/Example2/Example2.ino @@ -0,0 +1,38 @@ + +/* +a fast lightweight real time library to monitor and modify arduino variables via serial usb +this library is compatible with arduino unoR3, unoR4, Mega, and shields based on esp8266, esp32 +https://github.com/lozziboy/arduino-serial-variable-table +*/ + +// include cSerialWatcher class +#include "cSerialWatcher.h" + +// create SerialWatcher instance +cSerialWatcher SerialWatcher(Serial); + +// create global variables +char w[25] = "my array char"; +int u = 15; +int v = 26; +float f = 13.6; +float g = 9.1; +byte b = 12; + +void setup() { + Serial.begin(115200); // init serial communication +} + +void loop() { + + // map variables + SerialWatcher.Map(F("w"), w); + SerialWatcher.Map(F("u"), u); + SerialWatcher.Map(F("v"), v); + SerialWatcher.Map(F("f"), f); + SerialWatcher.Map(F("g"), g); + SerialWatcher.Map(F("b"), b); + + // update watch stream + SerialWatcher.Update(); +}