App for BLE Nano to monitor the power consumption for a specific location, by intercepting the led flashes of a standard power meter. It counts and log the flashes for each second. It works with RedBear App for smart phone (Simple Chat App).

Dependencies:   BLE_API lib_mma8451q mbed nRF51822

Fork of nRF51822_DataLogger_with_Chat by Valentin Tanasa

Revision:
4:d7872f84c03c
Parent:
2:4b66b69c7ecb
Child:
5:ee7e1a9e1985
--- a/main.cpp	Mon Jul 27 06:52:44 2015 +0000
+++ b/main.cpp	Thu Mar 31 15:20:16 2016 +0000
@@ -81,9 +81,7 @@
         memset(txPayload, 0, TXRX_BUF_LEN);
         memcpy(txPayload, buf, TXRX_BUF_LEN);       
         pc.printf("WriteHandler \r\n");
-        pc.printf("Length: ");
-        pc.putc(bytesRead);
-        pc.printf("\r\n");
+        pc.printf("Length: %d \r\n", nbytesRead);
         pc.printf("Data: ");
         for(index=0; index<bytesRead; index++)
         {
@@ -102,9 +100,7 @@
         {
             ble.updateCharacteristicValue(rxCharacteristic.getValueAttribute().getHandle(), rx_buf, rx_len); 
             pc.printf("RecHandler \r\n");
-            pc.printf("Length: ");
-            pc.putc(rx_len);
-            pc.printf("\r\n");
+            pc.printf("Length: %d \rn\n",rx_len);            
             rx_len = 0;
             break;
         }