based on another example
Dependencies: SDFileSystem mbed
Fork of nucleo_sdcard by
Revision 1:ea59a24226fc, committed 2016-10-26
- Comitter:
- dimmu8410
- Date:
- Wed Oct 26 00:13:12 2016 +0000
- Parent:
- 0:b0bc1d4fe0d4
- Commit message:
- okokokok_sd
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r b0bc1d4fe0d4 -r ea59a24226fc main.cpp --- 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"); }