Sample program for using Pubnub on AT&T IoT Starter Kit (which has the WNC modem)
Dependencies: Pubnub_mbed2_sync WNCInterface mbed-rtos mbed
Fork of WNCInterface_M2XMQTTdemo by
Diff: main.cpp
- Revision:
- 1:ceb54785e67c
- Parent:
- 0:b476b3f6cb65
- Child:
- 2:e355d362a2d8
--- a/main.cpp Wed Sep 21 18:21:52 2016 +0000 +++ b/main.cpp Tue Sep 27 19:54:39 2016 +0000 @@ -10,7 +10,6 @@ #define CRLF "\n\r" - //Device ID: 8bcfff8a8514678f0fc6b56cb0f55c87 //Master Key: 3d1f3c0f42a8c541205f706f62c65330 @@ -36,17 +35,21 @@ Client client; M2XMQTTClient m2xClient(&client, m2xKey); WNCInterface eth; +MODSERIAL pc(USBTX,USBRX,256,256); int main() { int response, cnt=1; double tval = 0.9; double hval = 101.0; - eth.init(); + pc.baud(115200); + printf(CRLF CRLF "M2X MQTT Test starting..." CRLF); + + eth.init(NULL,&pc); eth.connect(); - printf(CRLF CRLF "M2X MQTT Test..." CRLF); - printf("IP Address: %s" CRLF, eth.getIPAddress()); - + printf("IP Address: %s" CRLF, eth.getIPAddress()); + eth.doDebug(0); + while (true) { tval += 0.1; printf("\r\n\r\nSending readings #%d\r\n",cnt++); @@ -72,7 +75,6 @@ elevation++; delay(6000); -//eth.doDebug(3); } }