header file
Dependencies: N5110 PowerControl SRF02 beep mbed
Diff: datafile.h
- Revision:
- 3:bbfabbbc4291
- Parent:
- 2:184524f95eb1
--- a/datafile.h Thu May 07 16:43:32 2015 +0000 +++ b/datafile.h Mon May 11 18:47:19 2015 +0000 @@ -1,16 +1,23 @@ +/** +@file datafile.h +@function for writing files +*/ LocalFileSystem local("local"); //create local file system -void writeDataToFile(int data); +void writeDataToFile(char* data1); -void writeDataToFile(int data) +void writeDataToFile(char* data1) { //leds = 15; //turn on leds for feedback FILE *fp = fopen("/local/log.csv", "a"); //open 'log.csv' for apending //if the file doesnt exist it is created, if it exists, data is apended to the end - fprintf(fp, "%0.2f C\n",data); //print string to file + fprintf(fp, "%0.2f cm\n",data1); //print string to file + //fprintf(fp, "%0.2f C\n",data2); //print string to file + //fprintf(fp, "%0.2f C\n",data3); //print string to file fclose(fp); //close file //leds = 0; //turn off leds to signify file access has finished -} \ No newline at end of file +} +