Variabls Firmware Library to Connect Device to variabls Platform.
Our works is an open source. Feel free to add, modify, and use it.
For full Documentation, please visit here.
To use this library, simply download the library and paste it into your lib
project folder. This code below is the simple example of main.cpp
code to use the Variabls Library:
#include <VariablsLib.h>
#include <VariablsTask.h>
VariablsLib variabls;
VariablsTask task;
void demoTask()
{
float sendRandom = random(100000, 500000) / 100.00;
variablsMQTT.publish("demo/test", 1, sendRandom);
}
void setup()
{
variabls.begin();
task.setTask("testRandom", 15000L, demoTask, 0);
}
void loop()
{
variabls.run();
task.run();
}
It will push random number every 15000 ms to topic 'demo/test' forever.
See the more code example
For full Documentation, please visit here.
Many thanks to those who build an amazing open-source code and still maintain it up till today. The inspiration came from this amazing Author:
- Autoconnect by Hieromon
- ArduinoMQTT by 256dpi
- ArduinoJSON by bblanchon
- NTPClient by Arduino
Hamid Rasyid Muhammad Sidargo