basic test to get quaternion over ble and use it to improve balance board skills

Dependencies:   BLE_API eMPL_MPU6050 mbed nRF51822

Fork of Seeed_Tiny_BLE_Get_Started by Seeed

Files at this revision

API Documentation at this revision

Comitter:
squirelo
Date:
Sun Aug 28 16:48:12 2016 +0000
Parent:
3:24e365bd1b97
Commit message:
basic test with quaternion

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 24e365bd1b97 -r 1704ddee411f main.cpp
--- a/main.cpp	Thu Nov 05 06:58:30 2015 +0000
+++ b/main.cpp	Sun Aug 28 16:48:12 2016 +0000
@@ -94,12 +94,12 @@
 
 void tap_cb(unsigned char direction, unsigned char count)
 {
-    LOG("Tap motion detected\n");
+    LOG("Touched the ground");
 }
 
 void android_orient_cb(unsigned char orientation)
 {
-    LOG("Oriention changed\n");
+    //LOG("Oriention changed\n");
 }
 
 
@@ -173,7 +173,7 @@
     ble.accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED);
     ble.setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED);
     ble.accumulateAdvertisingPayload(GapAdvertisingData::SHORTENED_LOCAL_NAME,
-                                     (const uint8_t *)"smurfs", sizeof("smurfs"));
+                                     (const uint8_t *)"balanceboard", sizeof("balanceboard"));
     ble.accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LIST_128BIT_SERVICE_IDS,
                                      (const uint8_t *)UARTServiceUUID_reversed, sizeof(UARTServiceUUID_reversed));
     DFUService dfu(ble);                                 
@@ -218,7 +218,7 @@
                     // LOG("GYRO: %d, %d, %d\n", gyro[0], gyro[1], gyro[2]);
                 }
                 if (sensors & INV_XYZ_ACCEL) {
-                    //LOG("ACC: %d, %d, %d\n", accel[0], accel[1], accel[2]);
+                    // LOG("ACC: %d, %d, %d\n", accel[0], accel[1], accel[2]);
                 }
                 
                 /* Unlike gyro and accel, quaternions are written to the FIFO in
@@ -226,7 +226,7 @@
                  * to dmp_set_orientation during initialization.
                  */
                 if (sensors & INV_WXYZ_QUAT) {
-                    // LOG("QUAT: %ld, %ld, %ld, %ld\n", quat[0], quat[1], quat[2], quat[3]);
+                    LOG("QUAT: %ld, %ld, %ld, %ld\n", quat[0], quat[1], quat[2], quat[3]);
                 }
                 
                 if (sensors) {