IDT Optical Sensors / Mbed 2 deprecated OB1203_IDT

Dependencies:   mbed OB1203_example_driver

Revision:
11:640cced1ee5d
Parent:
10:7fbf298ee05f
Child:
12:5de5f550e765
--- a/main.cpp	Fri Jun 01 13:17:34 2018 +0000
+++ b/main.cpp	Tue Jun 19 12:58:45 2018 +0000
@@ -21,7 +21,7 @@
 //USER CONFIGURABLE*********
 bool mode = 1; //0 for PS_LS, 1 for PPG
 bool meas_ps = 1;
-bool spo2 = 1; //0 for HR, 1 for SpO2
+bool spo2 = 0; //0 for HR, 1 for SpO2
 bool afull = 1; //use Afull interrupt--otherwise PPG new data interrupt
 bool meas_temp = 0;
 //****************************
@@ -87,6 +87,9 @@
     ob1203.ps_int_en = PS_INT_ON;
     ob1203.ls_persist = LS_PERSIST(2);
     ob1203.ps_persist = PS_PERSIST(2);
+    
+    
+    //BIO SETTINGS
     //int
     if(afull)
     {
@@ -112,17 +115,20 @@
     ob1203.ppg_ps_gain = PPG_PS_GAIN_1;
     ob1203.ppg_pow_save = PPG_POW_SAVE_OFF;
     ob1203.led_flip = LED_FLIP_OFF;
-    ob1203.ch1_can_ana = PPG_CH1_CAN(1);
-    ob1203.ch2_can_ana = PPG_CH2_CAN(1);
-    ob1203.ppg_avg = PPG_AVG(4); //2^n
-    ob1203.ppg_rate = PPG_RATE(1);
-    ob1203.ppg_pwidth = PPG_PWIDTH(2);
-    ob1203.ppg_freq = PPG_FREQ_50HZ;
-//    ob1203.ppg_freq = PPG_FREQ_60HZ;
+    ob1203.ch1_can_ana = PPG_CH1_CAN(0);
+    ob1203.ch2_can_ana = PPG_CH2_CAN(0);
+    ob1203.ppg_avg = PPG_AVG(0); //2^n
+    ob1203.ppg_rate = PPG_RATE(4);
+    ob1203.ppg_pwidth = PPG_PWIDTH(5);
+//    ob1203.ppg_freq = PPG_FREQ_50HZ;
+    ob1203.ppg_freq = PPG_FREQ_60HZ;
     ob1203.bio_trim = 3; //max 3
     ob1203.led_trim = 0x00; //max current
     ob1203.ppg_LED_settling = PPG_LED_SETTLING(2);
     ob1203.ppg_ALC_track = PPG_ALC_TRACK(2);
+    ob1203.diff = DIFF_ON; 
+    ob1203.alc = ALC_ON; 
+    ob1203.sig_out = SIGNAL_OUT; 
     
 //    ob1203.ppg_freq = PPG_FREQ_50HZ;
 
@@ -320,8 +326,8 @@
                             
                             
                             //PRINT RAW DATA
-//                             pc.printf("%d, %d, %d\r\n",t.read_us(),ppgData[2*n],ppgData[2*n+1]); //print with us counter time stamp (use only with slower data rates or averaging as this slows down the data printing);
-                             pc.printf("%d, %d\r\n",ppgData[2*n],ppgData[2*n+1]); //print without us timer (faster)
+                             pc.printf("%d, %d, %d\r\n",t.read_us(),ppgData[2*n],ppgData[2*n+1]); //print with us counter time stamp (use only with slower data rates or averaging as this slows down the data printing);
+//                             pc.printf("%d, %d\r\n",ppgData[2*n],ppgData[2*n+1]); //print without us timer (faster)
                             //PRINT AVG DATA
 //                            pc.printf("%d,%d,%d\r\n",t.read_us(),IRavg/running_avg,Ravg/running_avg);
 //                            pc.printf("%d,%d\r\n",IRavg/running_avg-IRbaseline/running_baseline, Ravg/running_avg-Rbaseline/running_baseline);