Simple demo application demonstrating use of Nucleo_BLE_DemoApp

Dependencies:   Nucleo_BLE_API Nucleo_BLE_BlueNRG Nucleo_BLE_DemoApp mbed

Files at this revision

API Documentation at this revision

Comitter:
berlingeradam
Date:
Wed May 27 18:59:24 2015 +0000
Commit message:
Simple demo application

Changed in this revision

Nucleo_BLE_API.lib Show annotated file Show diff for this revision Revisions of this file
Nucleo_BLE_BlueNRG.lib Show annotated file Show diff for this revision Revisions of this file
Nucleo_BLE_DemoApp.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
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Nucleo_BLE_API.lib	Wed May 27 18:59:24 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/teams/ST-Americas-mbed-Team/code/Nucleo_BLE_API/#79e5c08cbcc7
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Nucleo_BLE_BlueNRG.lib	Wed May 27 18:59:24 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/teams/Cortex-challenge-team/code/Nucleo_BLE_BlueNRG/#fe944335161b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Nucleo_BLE_DemoApp.lib	Wed May 27 18:59:24 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/teams/Cortex-challenge-team/code/Nucleo_BLE_DemoApp/#510cac0a0250
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed May 27 18:59:24 2015 +0000
@@ -0,0 +1,51 @@
+/* Bluetooth low energy demo application
+ * Copyright (c) 2015 Adam Berlinger
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "mbed.h"
+#include "DemoAppService.h"
+
+
+extern bool user_button_pressed;
+bool connected = false;
+bool UpdatedEnabled = false;
+
+DemoAppService *demoService;
+PwmOut led(LED1);
+
+void demoCallback(uint8_t event){
+    /* Nastaveni stridy PWM signalu */
+    if(event & DemoAppService::EVENT_SLIDER1_CHANGED){
+        int x = 1 << (demoService->getSlider1Value() / 10);
+        led.write((float)(x / (float)(1 << 10)));
+    }
+    /* Nastaveni periody PWM signalu */
+    if(event & DemoAppService::EVENT_SLIDER2_CHANGED){
+        led.period(1.0f / (demoService->getSlider2Value() + 1));
+    }
+}
+
+int main(void)
+{
+  demoService = startDemoBLE("Demo App");
+  demoService->setCallback(demoCallback);
+
+  led = 0.0f;
+
+  while (true) 
+  {
+    demoService->waitForEvent();
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed May 27 18:59:24 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/cbbeb26dbd92
\ No newline at end of file