mDot project for Multitech and Explora worhshop

Dependencies:   mDot_X_NUCLEO_IKS01A1 libmDot-dev-mbed5-deprecated

Fork of mDot-IKS01A1 by Peter Ferland

Revision:
3:d34798ffcaf8
Parent:
2:d0873bb1255f
Child:
4:142c85980a6f
diff -r d0873bb1255f -r d34798ffcaf8 main.cpp
--- a/main.cpp	Fri Dec 09 20:51:48 2016 +0000
+++ b/main.cpp	Fri Dec 09 22:06:09 2016 +0000
@@ -26,17 +26,7 @@
     dot->setEvents(&events);
 
 
-    /* Instantiate the expansion board */
-    X_NUCLEO_IKS01A1 *mems_expansion_board = X_NUCLEO_IKS01A1::Instance(I2C_SDA, I2C_SCL, PC_1);
 
-    /* Retrieve the composing elements of the expansion board */
-    GyroSensor *gyroscope = mems_expansion_board->GetGyroscope();
-    MotionSensor *accelerometer = mems_expansion_board->GetAccelerometer();
-    MagneticSensor *magnetometer = mems_expansion_board->magnetometer;
-    HumiditySensor *humidity_sensor = mems_expansion_board->ht_sensor;
-    PressureSensor *pressure_sensor = mems_expansion_board->pt_sensor;
-    TempSensor *temp_sensor1 = mems_expansion_board->ht_sensor;
-    TempSensor *temp_sensor2 = mems_expansion_board->pt_sensor;
     
 
     if (!dot->getStandbyFlag()) {
@@ -81,6 +71,18 @@
         logInfo("restoring network session from NVM");
         dot->restoreNetworkSession();
     }
+            /* Instantiate the expansion board */
+    X_NUCLEO_IKS01A1 *mems_expansion_board = X_NUCLEO_IKS01A1::Instance(I2C_SDA, I2C_SCL, PC_1);
+
+    /* Retrieve the composing elements of the expansion board */
+    GyroSensor *gyroscope = mems_expansion_board->GetGyroscope();
+    MotionSensor *accelerometer = mems_expansion_board->GetAccelerometer();
+    MagneticSensor *magnetometer = mems_expansion_board->magnetometer;
+    HumiditySensor *humidity_sensor = mems_expansion_board->ht_sensor;
+    PressureSensor *pressure_sensor = mems_expansion_board->pt_sensor;
+    TempSensor *temp_sensor1 = mems_expansion_board->ht_sensor;
+    TempSensor *temp_sensor2 = mems_expansion_board->pt_sensor;
+
     
     while (true) {
         std::vector<uint8_t> tx_data;