I-O DATA DEV2 / Mbed 2 deprecated Nucleo_SD_test

Dependencies:   mbed SDFileSystem

Files at this revision

API Documentation at this revision

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)