Sample BLE thermometer profile for nRF51-DK with sensing from LM35

Dependencies:   BLE_API mbed nRF51822 X_NUCLEO_IDB0XA1

Fork of BLE_Thermometer by Bluetooth Low Energy

Revision:
2:a34d554282b0
Parent:
1:2deb859ed1a3
Child:
4:83c07b0e93d6
--- a/main.cpp	Tue Sep 02 16:24:12 2014 +0000
+++ b/main.cpp	Wed Sep 03 16:25:50 2014 +0000
@@ -22,7 +22,7 @@
 BLEDevice  ble;
 DHT        sensor(D10, DHT11);
 
-#define NEED_CONSOLE_OUTPUT 0 /* Set this if you need debug messages on the console;
+#define NEED_CONSOLE_OUTPUT 1 /* Set this if you need debug messages on the console;
                                * it will have an impact on code-size and power consumption. */
 
 #if NEED_CONSOLE_OUTPUT
@@ -53,7 +53,7 @@
 int main(void)
 {
     Ticker ticker;
-    ticker.attach(periodicCallback, 1);
+    ticker.attach(periodicCallback, 3);
 
     DEBUG("Initialising the nRF51822\n\r");
     ble.init();
@@ -75,9 +75,12 @@
         if (triggerSensorPolling) {
             triggerSensorPolling = false;
 
+            wait(2);
+            
             /* Do blocking calls or whatever is necessary for sensor polling. */
             /* In our case, we simply update the dummy HRM measurement. */
             int error = sensor.readData();
+            DEBUG("sensor read returned %d\r\n", error);
             if (!error) {
                 thermometerService.updateTemperature(sensor.ReadTemperature(CELCIUS));
             }