MPU6050センサ Wallbot_BLE用 サンプル

Dependencies:   BLE_API mbed nRF51822

Revision:
12:6ef51c5442dd
Parent:
11:5a3dcafaffbb
Child:
13:7b4edf8b8c1b
diff -r 5a3dcafaffbb -r 6ef51c5442dd main.cpp
--- a/main.cpp	Sun Mar 15 12:13:13 2015 +0000
+++ b/main.cpp	Wed Mar 18 15:29:26 2015 +0000
@@ -15,10 +15,10 @@
 #endif // #if NEED_CONSOLE_OUTPUT //
 */
 
-//#define MIN_CONN_INTERVAL 250  /**< Minimum connection interval (250 ms) */
-//#define MAX_CONN_INTERVAL 350  /**< Maximum connection interval (350 ms). */
-#define CONN_INTERVAL 250  /**< Minimum connection interval (250 ms) */
-#define CONN_SUP_TIMEOUT  6000 /**< Connection supervisory timeout (6 seconds). */
+//#define MIN_CONN_INTERVAL 250  /**< Minimum connection interval */
+//#define MAX_CONN_INTERVAL 350  /**< Maximum connection interval */
+#define CONN_INTERVAL 313  /**< connection interval 250ms; in multiples of 0.125ms. (durationInMillis * 1000) / UNIT_0_625_MS; */
+#define CONN_SUP_TIMEOUT  8000 /**< Connection supervisory timeout (6 seconds); in multiples of 0.125ms. */
 #define SLAVE_LATENCY     4
 
 
@@ -126,7 +126,7 @@
     memcpy(accelPayload+sizeof(float)*7, &t, sizeof(t));
     timer.reset();
 
-    interval = (float)CONN_INTERVAL;
+    interval = (float)Gap::MSEC_TO_GAP_DURATION_UNITS(CONN_INTERVAL);
     memcpy(accelPayload+sizeof(float)*8, &interval, sizeof(interval));
 
     ble.updateCharacteristicValue(accelChar.getValueAttribute().getHandle(), accelPayload, sizeof(accelPayload));    //Mod