header file

Dependencies:   N5110 PowerControl SRF02 beep mbed

datafile.h

Committer:
probrania7
Date:
2015-05-07
Revision:
2:184524f95eb1
Child:
3:bbfabbbc4291

File content as of revision 2:184524f95eb1:


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     
}