based on another example

Dependencies:   SDFileSystem mbed

Fork of nucleo_sdcard by emin demir

Revision:
1:ea59a24226fc
Parent:
0:b0bc1d4fe0d4
--- a/main.cpp	Tue Feb 09 08:43:49 2016 +0000
+++ b/main.cpp	Wed Oct 26 00:13:12 2016 +0000
@@ -2,18 +2,21 @@
 #include "SDFileSystem.h"
  
 SDFileSystem sd(D11, D12, D13, D4, "sd"); // the pinout on the mbed Cool Components workshop board
- 
+Serial pc(USBTX,USBRX); 
 int main() {
-    printf("Hello World!\n");   
+    pc.printf("Iniciando envío\n\r");   
  
     mkdir("/sd/mydir", 0777);
     
-    FILE *fp = fopen("/sd/mydir/sdtest.txt", "w");
+    FILE *fp = fopen("/sd/mydir/BARRIOS.txt", "w");
     if(fp == NULL) {
         error("Could not open file for write\n");
     }
-    fprintf(fp, "Hello fun SD Card World!");
-    fclose(fp); 
+    for(int i=0;i<20;i++)
+    {
+      fprintf(fp, "dato1:%d,dato2:%d\n\r",i,i*5);
+    }
+      fclose(fp); 
  
-    printf("Goodbye World!\n");
+    pc.printf("Termino el envío\n\r");
 }