Seeed / Mbed 2 deprecated BLE_Color_Pixels

Dependencies:   BLE_API color_pixels mbed nRF51822

Fork of BLE_LCDDemo by Bluetooth Low Energy

Color pixels library using WS2812B and nRF51822 (16MHz)

http://www.seeedstudio.com/depot/bmz_cache/4/4f346dc15724a7b5a5c1383253aeefc9.image.530x397.jpg

/media/uploads/yihui/color_pixels.png

You can get the colorful led strip from seeed:

Click this link to download the color pixels app for android. The source code of the Android app is at https://github.com/Seeed-Studio/ble_color_pixels

If the BLE device is disconnected frequently, we can improve the stability by changing the BLE parameters - Advertising Duration (main.cpp), Min Interval and Max Interval (nRF51822/projectconfig.h)

#define CFG_GAP_CONNECTION_MIN_INTERVAL_MS           20                     /**< Minimum acceptable connection interval */
#define CFG_GAP_CONNECTION_MAX_INTERVAL_MS          200                     /**< Maximum acceptable connection interval */
Revision:
2:20990b390374
Parent:
0:6b62bf1cc2ba
Child:
3:fc93699018c9
--- a/main.cpp	Fri Aug 01 07:06:03 2014 +0000
+++ b/main.cpp	Fri Aug 01 07:07:12 2014 +0000
@@ -68,6 +68,9 @@
         DEBUG("onDataWritten()\n\r");
         uint16_t bytesRead;
         ble.readCharacteristicValue(rxCharacteristic.getHandle(), rxPayload, &bytesRead);
+        if (bytesRead < sizeof(rxPayload)) {
+            rxPayload[bytesRead] = 0;
+        }
         DEBUG("ECHO: %s\n\r", (char *)rxPayload);
         ble.updateCharacteristicValue(txCharacteristic.getHandle(), rxPayload, bytesRead);
         rxPayloadUpdated = true;