GPS + Logging

Dependencies:   FatFileSystem MBed_Adafruit-GPS-Library mbed

Fork of SDHCFileSystem by ESE-519

main.cpp

Committer:
nikhilesh1992
Date:
2015-11-03
Revision:
1:fe331bb498a0
Parent:
0:90601632692f
Child:
2:d5500685a878

File content as of revision 1:fe331bb498a0:

 #include "mbed.h"
 #include "string"
 #include "SDHCFileSystem.h"
 
 SDFileSystem sd(p5, p6, p7, p8, "sd"); // mosi, miso, sclk, cs
   
 int main() {
    unsigned char c;
    printf("Hello World!\n");   
 
    mkdir("/sd/mydir", 0777);
    
    FILE *fp = fopen("/sd/mydir/sdtest.txt", "r");
    if(fp == NULL) {
        error("Could not open file for write\n");
    }
    //fprintf(fp, "Hello fun SD Card World!");
    while(!feof(fp)){
        c = getc(fp);
        printf("%c", c);   
    }
    fclose(fp); 
    printf("Goodbye World!\n");
 }