Initial attempt to get ST MEMS working on the device.

Dependencies:   MQTT Nucleo_Sensor_Shield mbed-src mtsas

Fork of YYY_Dragonfly_ST_MEMS by Paul Jaeger

Revision:
2:26b2e25d323a
Parent:
1:0535928f65ca
--- a/main.cpp	Mon Jun 08 20:06:56 2015 +0000
+++ b/main.cpp	Tue Oct 20 00:37:18 2015 +0000
@@ -63,7 +63,7 @@
 //int _port = 1883;
 
 
-#define DATA_INTERVAL 30                                            // delay between samples, could be reduced for quicker response and more data
+#define DATA_INTERVAL 3                                            // delay between samples, could be reduced for quicker response and more data
 
 //void callback(char* topic, char* payload, unsigned int len)
 //{
@@ -77,7 +77,7 @@
 volatile float PRESSURE_Value;
 volatile AxesRaw_TypeDef ACC_Value;
 //volatile float HUMIDITY_Value;
-//volatile AxesRaw_TypeDef MAG_Value;
+volatile AxesRaw_TypeDef MAG_Value;
 //volatile AxesRaw_TypeDef GYR_Value;
 
 int main()
@@ -110,9 +110,9 @@
 
 //    printf("Signal Strength: %d\n\r", radio->getSignalStrength()); //Check the signal strength should be above 8
 
-    printf("data is stored at:\n\r\r");
-    printf("http://longpoll.aercloud.aeris.com/v1/%s/containers/subscriptions/%s/notificationChannels/longPoll?apiKey=%s",_AERCLOUD_ACCOUNT_ID,_AERCLOUD_SUBSCRIPTION_ID,_AERCLOUD_API_KEY);
-    printf(" \n\r \n\r");
+//    printf("data is stored at:\n\r\r");
+//    printf("http://longpoll.aercloud.aeris.com/v1/%s/containers/subscriptions/%s/notificationChannels/longPoll?apiKey=%s",_AERCLOUD_ACCOUNT_ID,_AERCLOUD_SUBSCRIPTION_ID,_AERCLOUD_API_KEY);
+//    printf(" \n\r \n\r");
 
 // If you suspect a connectivity issue, uncomment the code below and if ping works.  If you are not getting a
 //  valid ping, there's a connectivity problem.  First step is to verify you've got the right APN set
@@ -152,7 +152,7 @@
     mems_expansion_board->lps25h.GetPressure((float *)&PRESSURE_Value);
     mems_expansion_board->lsm6ds0.Acc_GetAxes((AxesRaw_TypeDef *)&ACC_Value);
 //        mems_expansion_board->hts221.GetHumidity((float *)&HUMIDITY_Value);
-//        mems_expansion_board->lis3mdl.GetAxes((AxesRaw_TypeDef *)&MAG_Value);
+        mems_expansion_board->lis3mdl.GetAxes((AxesRaw_TypeDef *)&MAG_Value);
 //        mems_expansion_board->lsm6ds0.Gyro_GetAxes((AxesRaw_TypeDef *)&GYR_Value);
 
 
@@ -161,7 +161,7 @@
         printf("Pressure:\t\t %f hPa\r\n", PRESSURE_Value);
         printf("Accelerometer (mg):\t X: %d, Y: %d, Z: %d\r\n", ACC_Value.AXIS_X, ACC_Value.AXIS_Y, ACC_Value.AXIS_Z);
 //        printf("Humidity:\t\t %f%%\r\n", HUMIDITY_Value);
-//        printf("Magnetometer (mGauss):\t mX: %d, mY: %d, mZ: %d\r\n", MAG_Value.AXIS_X, MAG_Value.AXIS_Y, MAG_Value.AXIS_Z);
+        printf("Magnetometer (mGauss):\t mX: %d, mY: %d, mZ: %d\r\n", MAG_Value.AXIS_X, MAG_Value.AXIS_Y, MAG_Value.AXIS_Z);
 //        printf("Gyroscope (mdps):\t X: %d, Y: %d, Z: %d\r\n", GYR_Value.AXIS_X, GYR_Value.AXIS_Y, GYR_Value.AXIS_Z);
         printf("\r\n");