A basic demo where a message sent over a BLE UART gets displayed on a low-power eInk display.

Dependencies:   BLE_API SharpLCD mbed nRF51822

Files at this revision

API Documentation at this revision

Comitter:
rgrover1
Date:
Thu Aug 07 14:29:13 2014 +0000
Parent:
2:20990b390374
Child:
4:0241d6beea9d
Commit message:
minor cosmetic changes.

Changed in this revision

SharpLCD.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/SharpLCD.lib	Fri Aug 01 07:07:12 2014 +0000
+++ b/SharpLCD.lib	Thu Aug 07 14:29:13 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/rgrover1/code/SharpLCD/#270ee57c0367
+http://mbed.org/users/rgrover1/code/SharpLCD/#761d0f489b61
--- a/main.cpp	Fri Aug 01 07:07:12 2014 +0000
+++ b/main.cpp	Thu Aug 07 14:29:13 2014 +0000
@@ -37,10 +37,10 @@
 DigitalOut led1(LED1);
 
 // The Nordic UART Service
-static const uint8_t uart_base_uuid[] = {0x6e, 0x40, 0x00, 0x01, 0xb5, 0xa3, 0xf3, 0x93, 0xe0, 0xa9, 0xe5,0x0e, 0x24, 0xdc, 0xca, 0x9e};
-static const uint8_t uart_tx_uuid[]   = {0x6e, 0x40, 0x00, 0x02, 0xb5, 0xa3, 0xf3, 0x93, 0xe0, 0xa9, 0xe5,0x0e, 0x24, 0xdc, 0xca, 0x9e};
-static const uint8_t uart_rx_uuid[]   = {0x6e, 0x40, 0x00, 0x03, 0xb5, 0xa3, 0xf3, 0x93, 0xe0, 0xa9, 0xe5,0x0e, 0x24, 0xdc, 0xca, 0x9e};
-static const uint8_t uart_base_uuid_rev[] = {0x9e, 0xca, 0xdc, 0x24, 0x0e, 0xe5, 0xa9, 0xe0, 0x93, 0xf3, 0xa3, 0xb5, 0x01, 0x00, 0x40, 0x6e};
+const uint8_t uart_base_uuid[]     = {0x6e, 0x40, 0x00, 0x01, 0xb5, 0xa3, 0xf3, 0x93, 0xe0, 0xa9, 0xe5, 0x0e, 0x24, 0xdc, 0xca, 0x9e};
+const uint8_t uart_tx_uuid[]       = {0x6e, 0x40, 0x00, 0x02, 0xb5, 0xa3, 0xf3, 0x93, 0xe0, 0xa9, 0xe5, 0x0e, 0x24, 0xdc, 0xca, 0x9e};
+const uint8_t uart_rx_uuid[]       = {0x6e, 0x40, 0x00, 0x03, 0xb5, 0xa3, 0xf3, 0x93, 0xe0, 0xa9, 0xe5, 0x0e, 0x24, 0xdc, 0xca, 0x9e};
+const uint8_t uart_base_uuid_rev[] = {0x9e, 0xca, 0xdc, 0x24, 0x0e, 0xe5, 0xa9, 0xe0, 0x93, 0xf3, 0xa3, 0xb5, 0x01, 0x00, 0x40, 0x6e};
 
 bool rxPayloadUpdated = false;
 uint8_t rxPayload[20] = {0,};
@@ -111,22 +111,14 @@
 
     lcd.enableDisplay();
     lcd.clear();
-    fb.printString(lookupFontFace("DejaVu Serif", 8),
-                   20,
-                   40,
-                   BLACK,
-                   "Init");
+    fb.printString(lookupFontFace("DejaVu Serif", 8), 20, 40, BLACK, "Init");
     lcd.drawFrameBuffer(fb);
 
     while (true) {
         if (rxPayloadUpdated) {
             fb.clear();
             lcd.drawFrameBuffer(fb);
-            fb.printString(lookupFontFace("DejaVu Serif", 8),
-                           20,
-                           40,
-                           BLACK,
-                           (const char *)rxPayload);
+            fb.printString(lookupFontFace("DejaVu Serif", 8), 20, 40, BLACK, (const char *)rxPayload);
             lcd.drawFrameBuffer(fb);
 
             rxPayloadUpdated = false;