asd
Dependencies: SDFileSystem mbed
Fork of SDFileSystem_HelloWorld by
SD card write - fat file system kl46z
main.cpp@5:61647cd1e811, 2017-08-24 (annotated)
- Committer:
- fblanc92
- Date:
- Thu Aug 24 00:47:10 2017 +0000
- Revision:
- 5:61647cd1e811
- Parent:
- 4:b77d7295fce4
Final Driver Sd - fat32 KL46z
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 0:bdbd3d6fc5d5 | 1 | #include "mbed.h" |
mbed_official | 0:bdbd3d6fc5d5 | 2 | #include "SDFileSystem.h" |
fblanc92 | 3:b2658ae9fc38 | 3 | |
fblanc92 | 2:8a7953dfeccd | 4 | SDFileSystem sd(PTA16,PTA17,PTA15,PTA14, "sd"); // the pinout on the mbed Cool Components workshop board |
fblanc92 | 2:8a7953dfeccd | 5 | int main() |
fblanc92 | 2:8a7953dfeccd | 6 | { |
fblanc92 | 5:61647cd1e811 | 7 | mkdir("/sd/MiDirectorio", 0777); //creacion directorio |
fblanc92 | 2:8a7953dfeccd | 8 | |
fblanc92 | 5:61647cd1e811 | 9 | FILE *fp = fopen("/sd/MiDirectorio/sdtest.txt", "a"); //puntero tipo file guarda directorio |
fblanc92 | 3:b2658ae9fc38 | 10 | /* if(fp == NULL) { |
fblanc92 | 3:b2658ae9fc38 | 11 | error("No se pudo abrir archivo para escritura\n"); |
fblanc92 | 3:b2658ae9fc38 | 12 | }; |
fblanc92 | 3:b2658ae9fc38 | 13 | */ |
fblanc92 | 4:b77d7295fce4 | 14 | fprintf(fp, "Hola Mundo - SD card"); //file print |
fblanc92 | 4:b77d7295fce4 | 15 | fprintf(fp,"\n"); |
fblanc92 | 5:61647cd1e811 | 16 | fprintf(fp,"Blanc Federico"); |
fblanc92 | 5:61647cd1e811 | 17 | fprintf(fp,"\n"); |
fblanc92 | 4:b77d7295fce4 | 18 | fprintf(fp,"Kenedy Patricio"); |
fblanc92 | 4:b77d7295fce4 | 19 | fprintf(fp,"\n"); |
fblanc92 | 4:b77d7295fce4 | 20 | fprintf(fp,"Scilabra Martin"); |
fblanc92 | 4:b77d7295fce4 | 21 | fprintf(fp,"\n"); |
fblanc92 | 4:b77d7295fce4 | 22 | fprintf(fp,"Serafini Gerardo"); |
fblanc92 | 3:b2658ae9fc38 | 23 | fclose(fp); //cierra archivo |
fblanc92 | 5:61647cd1e811 | 24 | }; |