Using the MBED BLE library and Nordic Puck library this is a simple scoring application using Bluetooth LE. It monitors three analog inputs and triggers on reception of a pulse on any one recording data for a short period on all three. This is then published via BLE characteristics. It's a demonstrator for a new UI dev toolkit that is under development.

Dependencies:   Puck mbed

Fork of Example_Puck_BLE by Nordic Semiconductor

Files at this revision

API Documentation at this revision

Comitter:
Bobty
Date:
Sat Aug 23 20:50:06 2014 +0000
Parent:
7:dc08df448ddc
Child:
9:f2b2ebc6d908
Commit message:
Working on single channel

Changed in this revision

SampleChannel.cpp Show annotated file Show diff for this revision Revisions of this file
SampleChannel.h 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/SampleChannel.cpp	Sat Aug 23 20:44:36 2014 +0000
+++ b/SampleChannel.cpp	Sat Aug 23 20:50:06 2014 +0000
@@ -15,7 +15,6 @@
     isCapturing = false;
     sampleThreshold = 100;
     sampleDivisor = 10;
-    testSampleCount = 0;
     sampleBaseVal = 0;
 }
 
@@ -31,13 +30,6 @@
 
 void SampleChannel::AddSample(uint16_t val)
 {
-    testSampleCount++;
-    if (testSampleCount == 1000)
-    {
-//        pLocalLogger->printf("%d AvgT %d, AvgW %d, low %d\n", val, GetAvgOfTriggerWindow(), GetAvgOutsideTriggerWindow(), GetLowest());
-        testSampleCount = 0;
-    }
-            
     // If capturing add to sample buf
     if (isCapturing)
     {
--- a/SampleChannel.h	Sat Aug 23 20:44:36 2014 +0000
+++ b/SampleChannel.h	Sat Aug 23 20:50:06 2014 +0000
@@ -23,7 +23,6 @@
         int GetAvgOfTriggerWindow();
         uint16_t GetLowest();
         Serial* pLocalLogger;
-        int testSampleCount;
         uint16_t sampleBaseVal;
         
     public:
--- a/main.cpp	Sat Aug 23 20:44:36 2014 +0000
+++ b/main.cpp	Sat Aug 23 20:50:06 2014 +0000
@@ -47,8 +47,6 @@
     
     sampleTimeout.attach_us(&SampleService, sampleIntervalUs);
 
-    return;
-    
     // service all channel's state machines
     bool isAnyChannelSampling = false;
     for (int chanIdx = 0; chanIdx < NUM_SAMPLE_CHANNELS; chanIdx++)
@@ -187,8 +185,6 @@
             lastServiceCount = serviceCount;
         }
         
-        continue;
-
         // Check for data ready
         for (int chanIdx = 0; chanIdx < NUM_SAMPLE_CHANNELS; chanIdx++)
         {