test

Dependencies:   BLE_API mbed nRF51822

Revision:
1:88e3620627f9
Parent:
0:a394a04bd0b7
--- a/main.cpp	Fri Feb 26 22:53:44 2016 +0000
+++ b/main.cpp	Fri Feb 26 23:27:37 2016 +0000
@@ -123,6 +123,13 @@
 double      CIEx[60];
 double      CIEy[60];
 
+double      xPPU9_5  = 0.05660;
+double      yPPU9_5  = 0.06549;
+
+
+double      xPPU9_4  = 0.05072;
+double      yPPU9_4  = 0.04818;
+
 double      xPPU2_14 = 0.03221;
 double      yPPU2_14 = 0.02597;
 
@@ -751,6 +758,14 @@
                         len = snprintf((char*) buf, MAX_REPLY_LEN, "%s", "4-8");  
                         m_ble.updateCharacteristicValue(m_uart_service_ptr->getRXCharacteristicHandle(), buf, len);
                     }                      
+                    else if( (xPPU9_4-xThresh<chromaX) && (chromaX<xPPU9_4+xThresh) && (yPPU9_4-yThresh<chromaY) && (chromaY<yPPU9_4+yThresh) ){
+                        len = snprintf((char*) buf, MAX_REPLY_LEN, "%s", "9-4");  
+                        m_ble.updateCharacteristicValue(m_uart_service_ptr->getRXCharacteristicHandle(), buf, len);
+                    }       
+                    else if( (xPPU9_5-xThresh<chromaX) && (chromaX<xPPU9_5+xThresh) && (yPPU9_5-yThresh<chromaY) && (chromaY<yPPU9_5+yThresh) ){
+                        len = snprintf((char*) buf, MAX_REPLY_LEN, "%s", "9-5");  
+                        m_ble.updateCharacteristicValue(m_uart_service_ptr->getRXCharacteristicHandle(), buf, len);
+                    }        
                     else{
                         len = snprintf((char*) buf, MAX_REPLY_LEN, "%s", "Unregistered");  
                         m_ble.updateCharacteristicValue(m_uart_service_ptr->getRXCharacteristicHandle(), buf, len);