works

Dependencies:   BLE_nRF8001 DebounceIn mbed mbed_BLEtry2

Fork of mbed_BLEfinal by SmartD

Files at this revision

API Documentation at this revision

Comitter:
sitakumar
Date:
Sat Apr 18 00:24:29 2015 +0000
Parent:
4:980b93c90fb7
Commit message:
4-17

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 980b93c90fb7 -r 7a4a5fbe72ac main.cpp
--- a/main.cpp	Tue Apr 14 23:13:16 2015 +0000
+++ b/main.cpp	Sat Apr 18 00:24:29 2015 +0000
@@ -20,11 +20,11 @@
 
 //for BLE
 int count = 0;
-unsigned char tempbuf[16] = {0};
+unsigned char tempbuf[2] = {0};
 unsigned char templen = 0;
-unsigned char decbuf[16] = {0};
+unsigned char decbuf[2] = {0};
 unsigned char declen = 0;
-unsigned char pHbuf[16] = {0};
+unsigned char pHbuf[2] = {0};
 unsigned char pHlen = 0;
 
 /*----- BLE Utility -------------------------------------------------------------------------*/
@@ -35,7 +35,7 @@
 BLEService               uartService          = BLEService("713d0000503e4c75ba943148f18d941e");
  
 // create characteristic
-BLECharacteristic    txCharacteristic = BLECharacteristic("713d0002503e4c75ba943148f18d941e", BLENotify, 30, 0);
+BLECharacteristic    txCharacteristic = BLECharacteristic("713d0002503e4c75ba943148f18d941e", BLENotify, 20, 0);
 BLECharacteristic    rxCharacteristic = BLECharacteristic("713d0003503e4c75ba943148f18d941e", BLENotify, 20, 1);
 /*--------------------------------------------------------------------------------------------*/
 unsigned int interval = 0;
@@ -183,6 +183,7 @@
                     int tempdecimal = (tempF-tempint)*100;
                     int pHint = pH;
                     int pHdecimal = (pH-pHint)*100;                    
+                    serial.printf("pH = %d, pHdec = %d\n\r", pHint,pHdecimal);
 //                    int tempint = 20;
 //                    int tempdecimal = 23;
 //                    int pHint = 9;