02/07/15

Dependencies:   mbed

Dependents:   TabbedGUIMbed

Data.cpp

Committer:
aidanPJG
Date:
2015-07-09
Revision:
46:70031ad8f2b9
Parent:
45:eb06f1d42938
Child:
47:1dc3b5f7bf4a

File content as of revision 46:70031ad8f2b9:

#include "mbed.h"

LocalFileSystem local("local"); 

void initialise()
{ 
    FILE *fp1 = fopen("/local/Datalog.xls", "a");       // opens or creates fill Datalog, and gives the headings
    fprintf(fp1, " Sensor Name \t Speed \n");
    fclose(fp1);
}

void data(int sensor_number, int speed)
{
    printf("it be printing");                            //testing  
    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);
}
    
void averageData()                                        //adds average data fom b2 to b6
{ 
    FILE *fp2 = fopen("/local/Datalog.xls", "a");       
    fprintf(fp2, " Average \t=SUM(B2:B6) / 5 \n"); 
    fclose(fp2);
}