Last active
November 7, 2017 18:42
-
-
Save PharkMillups/9ce8b9c5b0d84c9ad6cba5ced84f803a to your computer and use it in GitHub Desktop.
config-examples.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void | |
loop() | |
{ | |
//Create Json object with buffer to match data size | |
StaticJsonBuffer<JSON_OBJECT_SIZE(2) + 35> jsonBuffer; | |
JsonObject & root = jsonBuffer.createObject(); | |
root[F("interval")] = send_interval; //JSON MESSAGE | |
char buffer[HELIUM_MAX_DATA_SIZE]; | |
size_t used = root.printTo(buffer, HELIUM_MAX_DATA_SIZE); | |
// Send data to channel | |
channel_send(&channel, CHANNEL_NAME, buffer, used); | |
// Check if Config is updated with server | |
update_config(config.is_stale()); | |
// Wait a while till the next time | |
dexlay(send_interval); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment