Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed SDFileSystem
Revision 1:9d8797b91dda, committed 2020-12-03
- Comitter:
- hakusan270
- Date:
- Thu Dec 03 11:25:46 2020 +0000
- Parent:
- 0:b0a3ecd53c7d
- Commit message:
- SD card
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r b0a3ecd53c7d -r 9d8797b91dda main.cpp --- a/main.cpp Mon Mar 21 08:58:22 2016 +0000 +++ b/main.cpp Thu Dec 03 11:25:46 2020 +0000 @@ -15,21 +15,23 @@ int main() { + printf("Hello\r\n"); // SD filesystem - SDFileSystem *sd = new SDFileSystem(PB_15, PB_14, PB_13, PA_9, "sd", NC, SDFileSystem::SWITCH_NONE, 20000000); // mosi, miso, sclk, name, card detect, sw type, freq + SDFileSystem *sd = new SDFileSystem(D11, D12, D13, D10, "sd", NC, SDFileSystem::SWITCH_NONE, 20000000); // mosi, miso, sclk, name, card detect, sw type, freq while (1) { if (btn) continue; // file open - FILE *fp = fopen("/sd/test.txt", "r"); + FILE *fp = fopen("/sd/sd/test.txt", "r"); if (fp == NULL) { printf("open error!!\r\n"); while(1); } - +// fprintf(fp,"test write\n"); +// fclose(fp); // read text file char buf[1024]; while (fgets(buf, sizeof(buf), fp) != NULL)