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.
Data.cpp
00001 #include "Data.h" 00002 #include "UserInput.h" 00003 #include "mbed.h" 00004 #include <string> 00005 00006 extern LocalFileSystem local; 00007 UserInput userInput; 00008 00009 //sets up the excel file inputing the 00010 void Data::initialise() 00011 { 00012 FILE *fdata = fopen("/local/Datalog.xls", "w"); 00013 fprintf(fdata, "Company\t%sPipename\t%s", userInput.company(), userInput.pipeName()); 00014 fclose (fdata); 00015 } 00016 00017 void Data::counter(int count) 00018 { 00019 FILE *f1data = fopen("/local/Datalog.xls", "a"); 00020 fprintf(f1data, "Round %d of bending\nSensor number\tTime\tSpeed\n", count); 00021 fclose(f1data); 00022 } 00023 00024 void Data::logSpeed(int *sensor_number, float *time, float *speed) 00025 { 00026 FILE *f2data = fopen("/local/Datalog.xls", "a"); 00027 fprintf(f2data, "%d\t %f\t %f \n", *sensor_number, *time, *speed); 00028 fclose(f2data); 00029 }
Generated on Sat Jul 23 2022 19:08:16 by
1.7.2