Manometr mierzący ciśnienie w kołach
Dependencies: Cayenne-MQTT-mbed mbed TMP36 X_NUCLEO_IDW01M1v2 NetworkSocketAPI
Diff: main.cpp
- Revision:
- 5:294a8b1bca28
- Parent:
- 2:d7c27e622707
- Child:
- 6:e23a088bd573
diff -r c2bff5a58129 -r 294a8b1bca28 main.cpp --- a/main.cpp Wed Nov 09 17:21:56 2016 +0000 +++ b/main.cpp Fri Nov 11 18:31:11 2016 +0000 @@ -134,6 +134,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); TMP36 tmpSensor(A5); @@ -158,6 +159,7 @@ if ((error = mqttClient.publishData(DATA_TOPIC, 5, TYPE_TEMPERATURE, UNIT_CELSIUS, tmpSensor.read())) != CAYENNE_SUCCESS) { printf("Publish temperature 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); } }