![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
02/07/15
Dependencies: mbed
Diff: Data.cpp
- Revision:
- 43:8e154016dd89
- Parent:
- 42:b9055f46cfed
- Child:
- 44:3b45ec49bc44
--- a/Data.cpp Wed Jul 08 14:36:51 2015 +0000 +++ b/Data.cpp Wed Jul 08 15:16:26 2015 +0000 @@ -2,11 +2,18 @@ LocalFileSystem local("local"); -void data(int sensor_number, int speed){ - printf("Data program started"); //testing +void initialise() +{ + FILE *fp1 = fopen("/local/Datalog.xls", "a"); // opens or creates fill Datalog, and gives the headings + fprintf(fp1, " Sensor Name \t Time \n"); + fclose(fp1); +} + +void data(int sensor_number, int speed) +{ + printf("it be printing"); //testing - FILE *fp = fopen("/local/Data.xls", "a"); // Open "Data.txt" on the local file system for writing - fprintf(fp, " Sensor Name \t Time \n"); - fprintf(fp, " %d \t %d \f",sensor_number, speed); + FILE *fp = fopen("/local/Datalog.xls", "a"); // Open "Datalog + fprintf(fp, " %d \t %d \n",sensor_number, speed); //fills the tables with the results fclose(fp); } \ No newline at end of file