Intento 4

Dependencies:   BLE_API BLE_Driver I2C_Driver MAX30100 PROCESAMIENTO_DATOS_SP02 mbed millis nRF51822

Fork of MAX30100_FirstTry by Daniel Ferszt

Revision:
2:065060bb55f2
Parent:
1:33d65d13c46a
Child:
3:98ca4bf2e74a
--- a/mainbletest.cpp	Mon Mar 27 23:23:46 2017 +0000
+++ b/mainbletest.cpp	Tue Mar 28 02:08:37 2017 +0000
@@ -23,13 +23,14 @@
 int muestras_RED[200];
 int muestras_IR[200];
 int samples_index = 0;
-int matriz_minimos[30][2], matriz_maximos[30][2],max_min_period[2];
+int max_min_period[2];
 int pico_pico,cresta, valle, cantidad;
 float frecuencia,periodo;
 
 int index, aux1, nmuestra;
 
     char show[10];
+
 //******************
 
 DigitalOut LIVE_LED(p17, 1);
@@ -55,7 +56,7 @@
 
 void store_Samples(void){
     if (samples_index == 200){
-        periodo = valores(muestras_RED,matriz_minimos,matriz_maximos,max_min_period);
+        periodo = valores(muestras_IR,max_min_period);
         frecuencia=60/(periodo*0.02);
         samples_index = 0;
         sprintf(show, "%f", frecuencia);
@@ -65,6 +66,9 @@
     else{
         muestras_RED[samples_index] = sensor.RED;
         muestras_IR[samples_index] = sensor.IR;
+        sprintf(show, "%d", muestras_IR[samples_index]);
+        putBLE(show);
+        putBLE("\n");
         samples_index++;
         }
 }
@@ -76,6 +80,7 @@
     while(1){
         sensor.readSensor();
         store_Samples();
+        wait(0.019);
         
         }
     }