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:
- 12:8c00a7f5d483
- Parent:
- 11:2297d364af61
- Child:
- 13:a8e096e715bd
diff -r 2297d364af61 -r 8c00a7f5d483 main.cpp --- a/main.cpp Wed May 20 22:21:51 2015 +0000 +++ b/main.cpp Wed May 20 22:44:57 2015 +0000 @@ -2,10 +2,10 @@ #include "SDFileSystem.h" #include "Adafruit_ADS1015.h" #include "MCP40D17.h" -#include "BMP280.h" #include "wire.h" //Used with the RTC in this code. Will need to try and remove this, and also create the correct library/update addresses and registers for the RTC. #include "STC3100.h" #include "LSM303.h" +#include "BME280.h" #define SERIAL_BAUD_RATE 9600 #define SCL 20 @@ -15,7 +15,7 @@ I2C i2c(p22, p20); Adafruit_ADS1115 ads(&i2c); MCP40D17 DigPot(&i2c); -BMP280 bmpsensor(p22, p20); +BME280 bmesensor(p22, p20); STC3100 gasG(p22, p20); Serial pc(USBTX, USBRX); DigitalOut blower(p29, 0); @@ -143,7 +143,7 @@ //Mount the filesystem sd.mount(); FILE *fp = fopen(filename, "a"); - fprintf(fp, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%2.2f,%04.2f,%f,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\r\n", Year,Month,Date,Hour,Minutes,Seconds,omronReading,vInReading, vBlowerReading, omronDiff, gasG.getAmps(), gasG.getVolts(), gasG.getCharge(), bmpsensor.getTemperature(), bmpsensor.getPressure(),Honeywell_value,accel_x, accel_y, accel_z, mag_x, mag_y, mag_z); + fprintf(fp, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%2.2f,%04.2f,%2.2f,%f,%.0f,%.0f,%.0f,%.0f,%.0f,%.0f\r\n", Year,Month,Date,Hour,Minutes,Seconds,omronReading,vInReading, vBlowerReading, omronDiff, gasG.getAmps(), gasG.getVolts(), gasG.getCharge(), bmesensor.getTemperature(), bmesensor.getPressure(),bmesensor.getHumidity(),Honeywell_value,accel_x, accel_y, accel_z, mag_x, mag_y, mag_z); fclose(fp); //Unmount the filesystem sd.unmount();