MQTT example using the Freescale FRDM-K64F platform without additional hardware.
Dependencies: EthernetInterface MQTT mbed-rtos mbed HC_SR04_Ultrasonic_Library
Fork of K64F-RTOS-MQTT-Example by
Diff: main.cpp
- Revision:
- 2:24b2b10d3bc2
- Parent:
- 1:9caf46f4ed3e
- Child:
- 3:e33c80165703
diff -r 9caf46f4ed3e -r 24b2b10d3bc2 main.cpp --- a/main.cpp Thu Jul 27 16:08:25 2017 +0000 +++ b/main.cpp Wed Aug 02 15:34:50 2017 +0300 @@ -48,6 +48,7 @@ // MQTT message arrived callback function void messageArrived(MQTT::MessageData& md) { MQTT::Message &message = md.message; + pc.printf("Receiving MQTT message: %.*s\r\n", message.payloadlen, (char*)message.payload); if (message.payloadlen == 3) { @@ -72,7 +73,7 @@ // set SW2 and SW3 to generate interrupt on falling edge switch2.fall(&sw2_ISR); switch3.fall(&sw3_ISR); - + pc.baud(115200); pc.printf("\r\n\r\nWelcome to the K64F MQTT Demo!\r\n"); pc.printf("\r\nAttempting connect to local network...\r\n");