Example for connecting to Cayenne using the WIZ820ioInterface (W5200) library.

Dependencies:   Cayenne-MQTT-mbed WIZ820ioInterface mbed

Files at this revision

API Documentation at this revision

Comitter:
jburhenn
Date:
Fri Nov 11 18:25:05 2016 +0000
Parent:
6:100110aa70da
Commit message:
Added comment to explain how to change the interval for publishing data.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 100110aa70da -r a96efcf59599 main.cpp
--- a/main.cpp	Wed Nov 09 17:15:30 2016 +0000
+++ b/main.cpp	Fri Nov 11 18:25:05 2016 +0000
@@ -122,6 +122,7 @@
 */
 void loop(void)
 {
+    // Start the countdown timer for publishing data every 5 seconds. Change the timeout parameter to publish at a different interval.
     MQTTTimer timer(5000);
 
     while (true) {
@@ -151,6 +152,7 @@
             if ((error = mqttClient.publishData(DATA_TOPIC, 2, TYPE_BAROMETRIC_PRESSURE, UNIT_HECTOPASCAL, 800)) != CAYENNE_SUCCESS) {
                 printf("Publish barometric pressure failed, error: %d\n", error);
             }
+            // Restart the countdown timer for publishing data every 5 seconds. Change the timeout parameter to publish at a different interval.
             timer.countdown_ms(5000);
         }
     }