X-NUCLEO-IKS01A1 Environmental/Motion sensors data transmitted via X-NUCLEO-IDB04A1 BLE board. Compatible with iOS/Android ST BlueMS V2.1 application.

Dependencies:   BLE_API X_NUCLEO_IDB0XA1 X_NUCLEO_IKS01A1 mbed

Fork of Bluemicrosystem1 by ST Expansion SW Team

BlueMicrosystem application

This application is the mbed equivalent of ST BlueMicrosystem1 and provides an example of motion and environmental data exported via Bluetooth Low Energy to an Android or IOS device.
It runs on a ST NUCLEO-F401RE board connected with a X-NUCLEO-IKS01A1 and a X-NUCLEO-IDB04A1 expansion boards and is compatible with Android and iOS ST BlueMS smartphone applications (based on Android and iOS BlueST SDKs).
By default the application is not providing sensor fusion and activity recognition features. However sensor fusion can be enabled following the steps below:

  • Download and install osxMotionFX library on your PC.
  • Obtain the free license for your board following the instructions
  • Copy the correct license into Middlewares/ST/STM32_OSX_MotionFX_Library/osx_license.h of your mbed program folder
  • Copy Middlewares/ST/STM32_OSX_MotionFX_Library/Inc/osx_motion_fx.h file
  • Rename the provided .lib Keil binary library giving it a .ar extension, then copy it into Middlewares/ST/STM32_OSX_MotionFX_Library/Lib of your mbed program folder
  • Enable USE_SENSOR_FUSION_LIB macro into MotionFX_Manager.h file and recompile.
Revision:
2:d61a6f4d9682
Parent:
1:5fb861c45605
Child:
4:007539036889
--- a/main.cpp	Tue Oct 13 08:21:40 2015 +0000
+++ b/main.cpp	Tue Oct 13 12:38:14 2015 +0000
@@ -49,7 +49,7 @@
 static bool             isBlueButtonSequence = false;
 static                  Ticker BlueButtonTimer;
 static DigitalOut       greenled(LED1);
-static int8_t           txPower=-3;
+//static int8_t           txPower=-3;
 static unsigned char    isCal = 0;
 static uint16_t         TimeStamp=0;
 static int              BLEConnectionStatus =0;
@@ -71,14 +71,15 @@
 
 #ifdef CUST_SW_SERV
 static CustomSoftwareService   * p_customsoftwareservice = NULL;
+static osxMFX_output           * p_MotionFX_Engine_Out     = NULL;
 #endif
+static osxMFX_calibFactor        magOffset;
 
 #ifdef CUST_CONFIG_SERV
 static CustomConfigService     * p_customconfigservice     = NULL;
 #endif
 
-static osxMFX_output           * p_MotionFX_Engine_Out     = NULL;
-static osxMFX_calibFactor        magOffset;
+
 
 /***************************    Calibration functions    **************************/
 
@@ -644,8 +645,8 @@
     bool isgyro_lsm6ds0Present=false;
     bool isgyro_lsm6ds3Present=false;    
 #ifdef CUST_CONS_SERV   
-    static uint8_t          BufferToWrite[256];
-    static uint8_t          BytesToWrite;           
+//    static uint8_t          BufferToWrite[256];
+//    static uint8_t          BytesToWrite;           
 #endif    
     static bool SensorFusionOK = false;
 
@@ -663,7 +664,7 @@
 //#endif
     printf("\r\nSTMicroelectronics BlueMicrosystem1 W2ST:\r\n"
 #ifdef CUST_SENS_SERV
-           ,"\tGyro lsmds0 present: %d, lsmds3 present: %d\n\r"
+           "\tGyro lsmds0 present: %d, lsmds3 present: %d\n\r"
            "\tSend Every %dmS Temperature/Humidity/Pressure\r\n"
            "\tSend Every %dmS Acc/Gyro/Magneto\r\n\n"   
 #endif  
@@ -794,9 +795,10 @@
                     greenled =0;
             }
         }
+#ifdef CUST_SW_SERV        
     uint32_t QuaternionNumber =0;
     uint32_t CounterFloat =0;
-
+#endif
         
     while(1) {