Smartphone app control stepper motors via bluetooth low energy(BLE) on stm32F401RE x IHM02A1 x IDB05A1 V2 .

Dependencies:   BLE_API X_NUCLEO_IDB0XA1 X_NUCLEO_IHM02A1 mbed

Fork of BLE_LED_IDB0XA1_demo by NEHSROBOT

Revision:
3:e0efdb741bd4
Parent:
0:aae2d6c2a9eb
Child:
7:126b141a8c86
--- a/main.cpp	Fri Feb 19 15:28:35 2016 +0000
+++ b/main.cpp	Thu Feb 25 10:07:11 2016 +0000
@@ -28,7 +28,7 @@
 void disconnectionCallback(const Gap::DisconnectionCallbackParams_t *params)
 {
     (void)params;
-    BLE::Instance().gap().startAdvertising();
+    BLE::Instance().gap().startAdvertising(); // restart advertising
 }
 
 /**
@@ -74,8 +74,7 @@
     ble.gattServer().onDataWritten(onDataWrittenCallback);
 
     bool initialValueForLEDCharacteristic = true;
-    LEDService ledService(ble, initialValueForLEDCharacteristic);
-    ledServicePtr = &ledService;
+    ledServicePtr = new LEDService(ble, initialValueForLEDCharacteristic);
 
     /* setup advertising */
     ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED | GapAdvertisingData::LE_GENERAL_DISCOVERABLE);