Use MicroSD by STMF303K8

Dependencies:   SDFileSystem mbed

Files at this revision

API Documentation at this revision

Comitter:
mikawataru
Date:
Mon Oct 24 17:04:46 2016 +0000
Parent:
1:a8cfc313a2ae
Commit message:
Sample for MicroSD

Changed in this revision

SDFileSystem.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/SDFileSystem.lib	Tue Jun 28 17:35:17 2016 +0000
+++ b/SDFileSystem.lib	Mon Oct 24 17:04:46 2016 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/users/mbed_official/code/SDFileSystem/#7b35d1709458
+http://mbed.org/users/neilt6/code/SDFileSystem/#e4d2567200db
--- a/main.cpp	Tue Jun 28 17:35:17 2016 +0000
+++ b/main.cpp	Mon Oct 24 17:04:46 2016 +0000
@@ -9,20 +9,17 @@
 D11-----CMD
 D12-----DAT0
 D13-----CLK
-D1------CD
+D9------CD
 */
 
-
 #include "mbed.h"
 #include "SDFileSystem.h"
-
-SDFileSystem sd(D11, D12, D13, D1, "sd");//MOSI, MISO, SCLK, SSEL
-
-DigitalOut myled(LED1);
-
-int main() {
-    FILE *fp = fopen("/sd/test.txt", "w");
-    fprintf(fp,"HelloWorld\n");
-    fclose(fp);
+ 
+SDFileSystem sd(D11, D12, D13, D9, "sd"); // the pinout on the mbed Cool Components workshop board
+ 
+int main() {    
+    FILE *fp = fopen("/sd/sdtest.txt", "w");
+    fprintf(fp, "HelloWorld!");
+    fclose(fp); 
     free(fp);
 }