Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SDFileSystem ds3231 eeprom_Nikita mbed testUniGraphic_150217
Fork of merged_code2_3rd_nov_2017 by
sdcard.cpp
- Committer:
- nikitateggi
- Date:
- 2017-01-30
- Revision:
- 1:8316c23ec6b9
- Child:
- 2:3b7b71bfc941
File content as of revision 1:8316c23ec6b9:
#include "mbed.h" #include <stdio.h> #include "SDFileSystem.h" #include "sdcard.h" #include "rtc.h" #include "main.h" SDFileSystem sd(PTE1, PTE3, PTE2, PTE4, "sd"); FILE *fp=NULL; void sd_open_GLCfile(int pid) { char buffer[32]; char buffer1[32]; time_t epoch_time1; epoch_time1=rtc_read(); // strftime(buffer, 32, "GLC_%s", pid); sprintf(buffer1,"/sd/GLC_%d.csv",pid); fp = fopen(buffer1,"a"); fprintf(fp,"%s\n",ctime(&epoch_time1) ); } void sd_open_ECGfile(int pid) { // char buffer[32]; char buffer1[32]; time_t epoch_time1; epoch_time1=rtc_read(); // strftime(buffer, 32, "ECG_%d", pid); sprintf(buffer1,"/sd/ECG_%d.csv",pid); fp = fopen(buffer1,"a"); fprintf(fp,"%s\n",ctime(&epoch_time1) ); // strftime(buffer, 32, "ECG_%d-%m-%Y_%H_%M",localtime(&epoch_time1)); // fprintf(fp,"%d\n",buffer ); } void sd_open_BPfile(int pid) { char buffer[32]; char buffer1[32]; time_t epoch_time1; epoch_time1=rtc_read(); // strftime(buffer, 32, "ECG_%d", pid); sprintf(buffer1,"/sd/BP_%d.csv",pid); fp = fopen(buffer1,"a"); fprintf(fp,"%s\n",ctime(&epoch_time1) ); } void sd_write (int value) { fprintf(fp,"%d\n", value); } void sd_close() { fclose(fp); }