asd
Dependencies: SDFileSystem mbed
Fork of SDFileSystem_HelloWorld by
SD card write - fat file system kl46z
main.cpp@3:b2658ae9fc38, 2017-08-24 (annotated)
- Committer:
- fblanc92
- Date:
- Thu Aug 24 00:04:16 2017 +0000
- Revision:
- 3:b2658ae9fc38
- Parent:
- 2:8a7953dfeccd
- Child:
- 4:b77d7295fce4
Sin modif;
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 | 3:b2658ae9fc38 | 5 | |
fblanc92 | 2:8a7953dfeccd | 6 | int main() |
fblanc92 | 2:8a7953dfeccd | 7 | { |
fblanc92 | 3:b2658ae9fc38 | 8 | mkdir("/sd/MiDirectorio", 0777); //creacion directorio |
fblanc92 | 2:8a7953dfeccd | 9 | |
fblanc92 | 3:b2658ae9fc38 | 10 | FILE *fp = fopen("/sd/MiDirectorio/sdtest.txt", "w"); //puntero tipo file guarda directorio |
fblanc92 | 3:b2658ae9fc38 | 11 | /* if(fp == NULL) { |
fblanc92 | 3:b2658ae9fc38 | 12 | error("No se pudo abrir archivo para escritura\n"); |
fblanc92 | 3:b2658ae9fc38 | 13 | }; |
fblanc92 | 3:b2658ae9fc38 | 14 | */ |
fblanc92 | 3:b2658ae9fc38 | 15 | fprintf(fp, "Hola Mundo - SD card - Blanc Federico, Kenedy Patricio, Scilabra Martin, Serafini Gerardo"); //file print |
fblanc92 | 3:b2658ae9fc38 | 16 | fclose(fp); //cierra archivo |
fblanc92 | 3:b2658ae9fc38 | 17 | } |