Hepta SD
Dependencies: SDFileSystem mbed
Fork of Lab7-01_template by
Revision 14:1c1a7c1f1228, committed 2017-09-08
- Comitter:
- HEPTA
- Date:
- Fri Sep 08 01:49:24 2017 +0000
- Parent:
- 13:4fb761757895
- Commit message:
- Hepta Lab3
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 4fb761757895 -r 1c1a7c1f1228 main.cpp --- a/main.cpp Thu Sep 07 23:43:35 2017 +0000 +++ b/main.cpp Fri Sep 08 01:49:24 2017 +0000 @@ -4,7 +4,8 @@ Serial pc(USBTX,USBRX); SDFileSystem sd(p5, p6, p7, p8, "sd"); -int main(){ +int main() +{ pc.baud(9600); pc.printf("Hello world!\r\n"); char str[100]; @@ -16,8 +17,10 @@ for(int i=0; i<10; i++)fprintf(fp,"Hello my name is HEPTA!\r\n"); fclose(fp); fp = fopen("/sd/mydir/test.txt","r"); - fgets(str,100,fp); - puts(str); + for(int j = 0; j < 10; j++) { + fgets(str,100,fp); + puts(str); + } fclose(fp); pc.printf("Goodbye!!\r\n"); } \ No newline at end of file