BLE_HTS_Demo

This BLE_HTS_Demo program enables you to collect Temperature and Humidity data reading from sensor and transmit to collector device such as smartphone.

Below documents teach you how to install app that can connect and read data from our DELTA-DFCM-NNN40 development board. There are two versions, Android and iPhone.

/media/uploads/Marcomissyou/ios_app_for_environment_sensor_0518.pdf

/media/uploads/Marcomissyou/android_app_for_environment_sensor.pdf

Files at this revision

API Documentation at this revision

Comitter:
tsungta
Date:
Fri Oct 21 02:27:42 2016 +0000
Parent:
6:ba70d55f2de4
Child:
8:4653319ba675
Commit message:
Update to fit the usage of NQ620 platform

Changed in this revision

BLE_API.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
nRF51822.lib Show annotated file Show diff for this revision Revisions of this file
--- a/BLE_API.lib	Fri Aug 14 09:14:49 2015 +0000
+++ b/BLE_API.lib	Fri Oct 21 02:27:42 2016 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/teams/Bluetooth-Low-Energy/code/BLE_API/#8d316a3271a8
+http://mbed.org/teams/Bluetooth-Low-Energy/code/BLE_API/#65474dc93927
--- a/main.cpp	Fri Aug 14 09:14:49 2015 +0000
+++ b/main.cpp	Fri Oct 21 02:27:42 2016 +0000
@@ -28,7 +28,6 @@
 BLEDevice  ble;
  
 DigitalOut  led1(LED1);
-DigitalOut  led2(LED2);
 
 static const uint8_t UUID_HUMI_AND_UVI[] = {0xf5, 0x59, 0xa2, 0x49, 0xbe, 0xb1, 0x4c, 0x54, 0xa1, 0x0a, 0xc7, 0x95, 0x7e, 0x17, 0xf8, 0x67};
 uint8_t wrs_HumiUVI_payload[11] = {0, };
@@ -62,7 +61,7 @@
 */
 /**************************************************************************/
 //
-void disconnectionCallback(Gap::Handle_t handle, Gap::DisconnectionReason_t reason)
+void disconnectionCallback(const Gap::DisconnectionCallbackParams_t *params)
 {
     ble.startAdvertising();
 }
@@ -83,14 +82,10 @@
 
 int main(void)
 {
-    nrf_gpio_cfg_output(19);    // SWIO 
-    nrf_gpio_pin_clear(19);
     
-    if (hts221_init() & uvis25_init()) 
-    {   led2=1;
-    }
-    
-    
+    hts221_init();
+    uvis25_init(); 
+
     HTS221_Calib();
     
     Ticker ticker;
@@ -116,13 +111,19 @@
     
     while (true) {
 
-            HTS221_ReadTempHumi(&tempCelsius, &humi);
-            
-            if(uvis25_verify_product_id()){
+            if(hts221_verify_product_id())
+                HTS221_ReadTempHumi(&tempCelsius, &humi);
+            else {
+                //show dummy value
+                tempCelsius = 100;
+                humi = 100;
+            }
+                
+            if(uvis25_verify_product_id())
                 uvi = UVIS25_ReadUVI();
-            } else {
+            else
                 uvi = 100;  //Environment Sensor APP will show NO UV DEVICE.
-                }
+        
             /* Update the Temperature measurement */
             /* See --> https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.temperature_measurement.xml */
             tempCelsius_ix100 = tempCelsius * 100;      
--- a/mbed.bld	Fri Aug 14 09:14:49 2015 +0000
+++ b/mbed.bld	Fri Oct 21 02:27:42 2016 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/b9ad9a133dc7
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/25aea2a3f4e3
\ No newline at end of file
--- a/nRF51822.lib	Fri Aug 14 09:14:49 2015 +0000
+++ b/nRF51822.lib	Fri Oct 21 02:27:42 2016 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/teams/Nordic-Semiconductor/code/nRF51822/#ca9c9c2cfc6a
+http://mbed.org/teams/Nordic-Semiconductor/code/nRF51822/#c90ae1400bf2