Simple sample that demonstrates reading the FXOS8700CQ accelerometer, convert the data to JSON and send to an Azure IoT Hub.

Dependencies:   azure_umqtt_c iothub_mqtt_transport mbed-rtos mbed wolfSSL Socket lwip-eth lwip-sys lwip

Revision:
1:0366fad6e60c
Parent:
0:6c46c366f500
Child:
2:2b9acda15ef0
--- a/main.cpp	Fri Oct 14 21:16:25 2016 +0000
+++ b/main.cpp	Mon Oct 24 21:56:19 2016 +0000
@@ -157,7 +157,7 @@
 
 int main()
 {
-    const char *connectionString = "Your Azure IoT Hub connection string here";
+    const char *connectionString = "HostName=MarkRadML.azure-devices.net;DeviceId=MBEDTest;SharedAccessKey=O9UeI84dX74oZKd1xX/Mlavw+2CT7BWuv7QoGfg8Crk=";
 
     READING reading;
     Serial pc(USBTX, USBRX); // Primary output to demonstrate library
@@ -181,8 +181,8 @@
     if ((iotHubClientHandle = IoTHubClient_CreateFromConnectionString(connectionString, MQTT_Protocol)) == NULL)
         stall(pc, "ERROR: Could not create iotHubClientHandle\n");
         
-    //bool traceOn = false;
-    bool traceOn = true;
+    bool traceOn = false;
+    //bool traceOn = true;
     
     IoTHubClient_SetOption(iotHubClientHandle, "logtrace", &traceOn);
 
@@ -193,7 +193,7 @@
     if (IoTHubClient_SetMessageCallback(iotHubClientHandle, ReceiveMessageCallback, &receiveContext) != IOTHUB_CLIENT_OK)
         stall(pc, "ERROR: IoTHubClient_SetMessageCallback failed\r\n");
 
-    int LOOPCOUNT = 100;     // Set to -1 to run forever
+    int LOOPCOUNT = -1;     // Set to -1 to run forever
     
     char buffer[200];