ultrasonic distance sensor - time headerfile
Dependencies: N5110 PowerControl SRF02 beep mbed
Fork of Ultrasonicdistancesensor by
Diff: datafile.h
- Revision:
- 2:184524f95eb1
- Child:
- 3:bbfabbbc4291
diff -r 920749af1300 -r 184524f95eb1 datafile.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/datafile.h Thu May 07 16:43:32 2015 +0000 @@ -0,0 +1,16 @@ + +LocalFileSystem local("local"); //create local file system +void writeDataToFile(int data); + +void writeDataToFile(int data) +{ + //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 + + fclose(fp); //close file + + //leds = 0; //turn off leds to signify file access has finished +} \ No newline at end of file