BLE_Driver Example

Dependencies:   BLE_API BLE_Driver mbed nRF51822

Files at this revision

API Documentation at this revision

Comitter:
Ferszt
Date:
Mon Aug 22 01:04:43 2016 +0000
Commit message:
BLE Lib test

Changed in this revision

BLE_API.lib Show annotated file Show diff for this revision Revisions of this file
BLE_Driver.lib Show annotated file Show diff for this revision Revisions of this file
mainbletest.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
nRF51822.lib Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 882170680817 BLE_API.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/BLE_API.lib	Mon Aug 22 01:04:43 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/teams/Bluetooth-Low-Energy/code/BLE_API/#d494ad3e87bd
diff -r 000000000000 -r 882170680817 BLE_Driver.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/BLE_Driver.lib	Mon Aug 22 01:04:43 2016 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/teams/TESIS-SATUROMETRICA/code/BLE_Driver/#9b6cb48c1cc3
diff -r 000000000000 -r 882170680817 mainbletest.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mainbletest.cpp	Mon Aug 22 01:04:43 2016 +0000
@@ -0,0 +1,34 @@
+#include "mbed.h"
+#include "BLE_Driver.h"
+
+DigitalOut LIVE_LED(LED1, 1);
+DigitalOut CONECT_LED(LED2, 1);
+DigitalOut TEST_LED(LED3, 1);
+DigitalIn TEST_BUTTON(p17,PullUp);
+
+void callbackBLE(int event) {
+    switch (event){
+        case 1:     CONECT_LED = 0; break;
+        case 2:     CONECT_LED = 1; break;
+        default:    break;
+        }
+    }
+
+void periodicCallback(void){
+    LIVE_LED =! LIVE_LED;
+    uint8_t a;
+    a= getBLE();
+    if (a=='G')
+        TEST_LED = !TEST_LED;
+    }
+
+int main(void){
+    Ticker Flasher;
+    Flasher.attach(periodicCallback, 1);
+    iniBLE("Sigfried");
+    while(1){
+        if (TEST_BUTTON == 0)
+            putBLE("Hola\n\r");
+        }
+    }
+    
diff -r 000000000000 -r 882170680817 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Aug 22 01:04:43 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/4f6c30876dfa
\ No newline at end of file
diff -r 000000000000 -r 882170680817 nRF51822.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nRF51822.lib	Mon Aug 22 01:04:43 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/teams/Nordic-Semiconductor/code/nRF51822/#088f5738bf18