Test
Dependencies: Cayenne-MQTT-mbed ESP8266Interface mbed
Fork of Cayenne-ESP8266Interface by
Revision 9:4302de820980, committed 2016-11-11
- Comitter:
- jburhenn
- Date:
- Fri Nov 11 18:23:45 2016 +0000
- Parent:
- 8:691fe04970fc
- Child:
- 10:4f0cd8d9fbd5
- 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 |
--- a/main.cpp Wed Nov 09 17:13:47 2016 +0000
+++ b/main.cpp Fri Nov 11 18:23:45 2016 +0000
@@ -129,6 +129,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) {
@@ -158,6 +159,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);
}
}
