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:
1:5fb861c45605
Parent:
0:e93a11b4e044
Child:
2:d61a6f4d9682
--- a/main.cpp	Mon Oct 12 15:16:57 2015 +0000
+++ b/main.cpp	Tue Oct 13 08:21:40 2015 +0000
@@ -126,9 +126,8 @@
         /* Set the Calibration Structure */
 #ifdef USE_SENSOR_FUSION_LIB
         osx_MotionFX_setCalibrationData(&magOffset);
-#endif
+
         printf("Calibration Read from Flash\r\n");
-#ifdef USE_SENSOR_FUSION_LIB
         /* Control the calibration status */
         isCal = osx_MotionFX_compass_isCalibrated();
         printf("Check the Calibration =%d\r\n",isCal);
@@ -165,12 +164,12 @@
         printf("expMagVect->%X\r\n",magOffset.expMagVect);
 #endif /* BLUEMSYS_DEBUG_CALIB */
 
+#ifdef USE_SENSOR_FUSION_LIB
         /* Set the Calibration Structure */
         osx_MotionFX_setCalibrationData(&magOffset);
         printf("Calibration Read from RAM\r\n");
 
         /* Control the calibration status */
-#ifdef USE_SENSOR_FUSION_LIB
         isCal = osx_MotionFX_compass_isCalibrated();
         printf("Check the Calibration =%d\r\n",isCal);
 #endif
@@ -192,7 +191,6 @@
     /* Erase First Flash sector */
     FLASH_EraseInitTypeDef EraseInitStruct;
     uint32_t SectorError = 0;
-
     EraseInitStruct.TypeErase = TYPEERASE_SECTORS;
     EraseInitStruct.VoltageRange = VOLTAGE_RANGE_3;
     EraseInitStruct.Sector = BLUEMSYS_FLASH_SECTOR;