02/07/15
Dependencies: mbed
Diff: Data.cpp
- Revision:
- 64:809bd19f4e7c
- Parent:
- 61:e7f2a0e38360
- Child:
- 70:168d67695a65
diff -r 7d2bff227f65 -r 809bd19f4e7c Data.cpp --- a/Data.cpp Wed Aug 05 08:13:19 2015 +0000 +++ b/Data.cpp Wed Aug 05 08:44:12 2015 +0000 @@ -1,20 +1,21 @@ #include "mbed.h" LocalFileSystem local("local"); +extern Serial pc; void initialise(int counter ) { FILE *fp1 = fopen("/local/Datalog.xls", "a"); // opens or creates fill Datalog, and gives the headings fprintf(fp1, " Test %d \n", counter); - fprintf(fp1, " Sensor \t Time \t Speed \n"); + fprintf(fp1, " Sensor \t Total Time \t Time Diff \t Inst Speed \t Avg Speed\n"); fclose(fp1); } -void data(int sensor_number, double time, double speed) +void data(int sensor_number, double time, double speed, double timesTotal,double speedAvg) { // printf("it be printing"); //testing FILE *fp = fopen("/local/Datalog.xls", "a"); // Open "Datalog - fprintf(fp, " %d \t %lf \t %lf \n",sensor_number, time, speed); //fills the tables with the results + fprintf(fp, " %d \t %lf \t %lf \t %lf \t %lf \n",sensor_number + 1, timesTotal ,time, speed, speedAvg); //fills the tables with the results fclose(fp); }