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
Diff: main.cpp
- Revision:
- 60:5913d77c8a4a
- Parent:
- 59:a9b21b3d9afc
- Child:
- 62:edc9632bcc43
diff -r a9b21b3d9afc -r 5913d77c8a4a main.cpp --- a/main.cpp Thu Jul 02 19:16:12 2015 +0000 +++ b/main.cpp Mon Jul 06 21:36:50 2015 +0000 @@ -35,21 +35,19 @@ //UPAS0012 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.9198x4 + 4.995x3 - 9.0171x2 + 8.1039x - 2.1758 +//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.424; //V -float omronVMax = 1.8429; //V -float omronMFMin = 0.000; //g/L -float omronMFMax = 2.958; //g/L - +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 = 6.2912x4 - 56.643x3 + 195.7x2 - 329.36x + 245.2 +//y = 5.3839x4 - 51.627x3 + 191.09x2 - 345.9x + 277.63 float DP4 = 5.3839; float DP3 = -51.627; float DP2 = 191.09; @@ -215,13 +213,13 @@ //Test for errors if(RTC.OSF()) { //Don't proceed if the RTC needs reset RGB_LED.set_led(1,0,0); // error code/color - pc.printf("!Reset the time!\r\n"); + pc.printf("DATE/TIMESTAMP NEEDS TO BE RECALIBRATED!!\r\n"); goto fix_error; } RTC.get_time(); if(RTC.compare(Menu.f_sec, Menu.f_min, Menu.f_hour, Menu.f_day, Menu.f_month, Menu.f_year)) { //Don't proceed if it's already time to stop RGB_LED.set_led(1,0,0); // error code/color - pc.printf("!Fix the stop time!\r\n"); + pc.printf("Please fix the START or STOP times before exiting!\r\n"); goto fix_error; } pc.printf("You're done, you can now disconect the USB cable."); @@ -262,7 +260,7 @@ blower = 1; RTC.get_time(); - 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/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);