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:
73:47910ee23ebf
Parent:
72:0b36575ab00d
Child:
74:c574a6e04230
--- a/main.cpp	Thu Aug 20 16:28:37 2015 +0000
+++ b/main.cpp	Sun Aug 30 04:03:06 2015 +0000
@@ -58,28 +58,26 @@
 Timeout         logg;    //This is the logging call back object
 int RunReady =0;
 
-
-//UPAS0011 CALIBRATION TRANSFER FUNCTION COEFFICIENTS FROM 'UPAS v2 OSU-calibration primary flow data.xlsx'
+//UPAS0012 CALIBRATION TRANSFER FUNCTION COEFFICIENTS FROM 'UPAS v2 OSU-calibration primary flow data.xlsx'
 //mass flow sensor output signal (x) vs. mass flow (y)
-        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;
-
-
-
+//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 press;
@@ -135,7 +133,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/UPAS0011LOG000000000000---------------.txt";
+char filename[] = "/sd/UPAS0012LOG000000000000---------------.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)
 
 
@@ -398,7 +396,7 @@
        }
    
     
-    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);
+    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);
     FILE *fp = fopen(filename, "w");
     fclose(fp);
     //pc.printf("%d\r\n",digital_pot_setpoint);