Hepta SD
Dependencies: SDFileSystem mbed
Fork of Lab7-01_template by
Diff: main.cpp
- Revision:
- 14:1c1a7c1f1228
- Parent:
- 13:4fb761757895
--- 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