Code supports writing to the SD card as well as working with the Volckens group smartphone apps for the mbed HRM1017

Dependencies:   ADS1115 BLE_API BME280 Calibration CronoDot EEPROM LSM303 MCP40D17 NCP5623BMUTBG SDFileSystem SI1145 STC3100 mbed nRF51822

Fork of UPAS_BLE_and_USB by Volckens Group Sensors

Revision:
68:ca444d0760a0
Parent:
67:300418575137
Child:
69:7a99d97c334e
--- a/main.cpp	Sat Aug 15 02:10:49 2015 +0000
+++ b/main.cpp	Sat Aug 15 02:25:51 2015 +0000
@@ -30,33 +30,33 @@
 CronoDot RTC(p22, p20);
 EEPROM          E2PROM(p22, p20);
 Honduras_SerialMenu     Menu;
-DigitalOut      GPS_EN(p4,0);                     //pin 4 is used to enable and disable the GPS, in order to recive serial communications
+//DigitalOut      GPS_EN(p4,0);                     //pin 4 is used to enable and disable the GPS, in order to recive serial communications
 
 Timeout         stop;   //This is the stop call back object
 Timeout         logg;    //This is the logging call back object
 int RunReady =0;
 
 
-//UPAS0012 CALIBRATION TRANSFER FUNCTION COEFFICIENTS FROM 'UPAS v2 OSU-calibration primary flow data.xlsx'
+//UPAS0011 CALIBRATION TRANSFER FUNCTION COEFFICIENTS FROM 'UPAS v2 OSU-calibration primary flow data.xlsx'
 //mass flow sensor output signal (x) vs. mass flow (y)
-//y = -0.6154x4 + 3.7873x3 - 7.2564x2 + 7.0202x - 1.9413
-float MF4 = -0.6154;
-float MF3 = 3.7873;
-float MF2 = -7.2564;
-float MF1 = 7.0202;
-float MF0 = -1.9413;
-//Mass flow sensor polynomial deviation limits
-float omronVMin = 0.425; //V
-float omronVMax = 2.005; //V
-float omronMFMin = 0.002; //g/L
-float omronMFMax = 3.544; //g/L
-//DIGITAL POTENTIOSTAT dig-pot vs m_dot POLYNOMIAL TRANSFER FUNCTION COEFFICIENTS FROM 'UPAS v2 OSU-calibration primary flow data.xlsx'
-//y = 5.3839x4 - 51.627x3 + 191.09x2 - 345.9x + 277.63
-float DP4 = 5.3839;
-float DP3 = -51.627;
-float DP2 = 191.09;
-float DP1 = -345.9;
-float DP0 = 277.63;
+        float MF4 = -2.5778;
+        float MF3 = 15.031;
+        float MF2 = -30.738;
+        float MF1 = 27.914;
+        float MF0 = -8.794;
+//mass flow sensor polynomial deviation limits
+        float omronVMin = 0.645; //V
+        float omronVMax = 2.275; //V
+        float omronMFMin = 0.010; //g/L
+        float omronMFMax = 3.553; //g/L
+//UPAS0011 values dig_pot=9.2763x4 - 85.942x3 + 303.77x2 - 512.82x + 376.73
+        float DP4 = 9.2763;
+        float DP3 = -85.942;
+        float DP2 = 303.77;
+        float DP1 = -512.82;
+        float DP0 = 376.73;
+
+
 
 float press;
 float temp;
@@ -106,7 +106,7 @@
 //int refresh_Time = 10;   // refresh time in s, note calling read_GPS()(or similar) will still take how ever long it needs(hopefully < 1s)
 
 char device_name[] = "---------------";
-char filename[] = "/sd/UPAS0012LOG000000000000---------------.txt";
+char filename[] = "/sd/UPAS0011LOG000000000000---------------.txt";
 SDFileSystem sd(SPIS_PSELMOSI, SPIS_PSELMISO, SPIS_PSELSCK, SPIS_PSELSS, "sd"); // I believe this matches Todd's pinout, let me know if this doesn't work. (p12, p13, p15, p14)
 
 
@@ -318,7 +318,7 @@
         }
    
     
-    sprintf(filename, "/sd/UPAS0012LOG %02d-%02d-%02d %02d=%02d=%02d %s.txt",RTC.year,RTC.month,RTC.date,RTC.hour,RTC.minutes,RTC.seconds,device_name);
+    sprintf(filename, "/sd/UPAS0011LOG %02d-%02d-%02d %02d=%02d=%02d %s.txt",RTC.year,RTC.month,RTC.date,RTC.hour,RTC.minutes,RTC.seconds,device_name);
     FILE *fp = fopen(filename, "w");
     fclose(fp);
     //pc.printf("%d\r\n",digital_pot_setpoint);