GPS + Logging

Dependencies:   FatFileSystem MBed_Adafruit-GPS-Library mbed

Fork of SDHCFileSystem by ESE-519

Revision:
1:fe331bb498a0
Parent:
0:90601632692f
Child:
2:d5500685a878
--- a/main.cpp	Sat Jul 24 19:45:29 2010 +0000
+++ b/main.cpp	Tue Nov 03 01:58:12 2015 +0000
@@ -5,8 +5,20 @@
  SDFileSystem sd(p5, p6, p7, p8, "sd"); // mosi, miso, sclk, cs
    
  int main() {
-       
-       FILE *fp = fopen("/sd/myfile.txt", "w");
-       fprintf(fp, "\n\rHello World!\n\r");
-       fclose(fp);
+    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");
  }
\ No newline at end of file