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:
- 17:1baf7cab694e
- Parent:
- 16:210e5eaeb89b
- Child:
- 18:f530dfdc0c05
--- a/main.cpp Sat May 30 00:17:13 2015 +0000 +++ b/main.cpp Sat May 30 01:25:47 2015 +0000 @@ -20,6 +20,7 @@ STC3100 gasG(p22, p20); Serial pc(USBTX, USBRX); DigitalOut blower(p29, 0); +DigitalOut pbKill(p18, 1); LSM303 movementsensor(p22, p20); SI1145 lightsensor(p22, p20); @@ -41,7 +42,7 @@ int vBlowerReading; int omronDiff; int digital_pot_setpoint = 0x07; //min = 0x7F, max = 0x00 -char filename[] = "/sd/UPASLOG00.txt"; +char filename[] = "/sd/UPAS000000000000LOG.txt"; TwoWire Wire = TwoWire(NRF_TWI0); 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) @@ -100,7 +101,7 @@ wait (1); - for (uint8_t i = 0; i < 100; i++) { + /*for (uint8_t i = 0; i < 100; i++) { filename[11] = i/10 + '0'; filename[12] = i%10 + '0'; FILE *fp = fopen(filename, "r"); @@ -111,7 +112,12 @@ break; // leave the loop! } } + */ + get_time(); + sprintf(filename, "/sd/UPASLOG_%02d%02d%02d%02d%02d%02d.txt",Year,Month,Date,Hour,Minutes,Seconds); + FILE *fp = fopen(filename, "w"); + fclose(fp); while(1){