Example for connecting to Cayenne using the WIZnet_Library library.
Dependencies: Cayenne-MQTT-mbed WIZnet_Library mbed
Dependents: STM32F103C8T6-Cayenne-WIZnet_SD1306_BMP280
Revision 8:be2ac38e5bb9, committed 2016-11-11
- Comitter:
- jburhenn
- Date:
- Fri Nov 11 18:26:34 2016 +0000
- Parent:
- 7:33925feb04ca
- 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 33925feb04ca -r be2ac38e5bb9 main.cpp --- a/main.cpp Wed Nov 09 17:17:32 2016 +0000 +++ b/main.cpp Fri Nov 11 18:26:34 2016 +0000 @@ -126,6 +126,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) { @@ -155,6 +156,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); } }