mbed sd

Dependencies:   SDFileSystem mbed

Files at this revision

API Documentation at this revision

Comitter:
jh_ndm
Date:
Fri Jul 15 01:21:28 2016 +0000
Child:
1:456047999cb0
Commit message:
dfrobot SD

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
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SDFileSystem.lib	Fri Jul 15 01:21:28 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/SDFileSystem/#7b35d1709458
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Jul 15 01:21:28 2016 +0000
@@ -0,0 +1,20 @@
+#include "mbed.h"
+#include "SDFileSystem.h"
+ 
+SDFileSystem sd(PA_14, PA_13, PA_12, PA_11, "sd"); // the pinout on the mbed Cool Components workshop board  SDFileSystem sd(PB_03, PB_02, PB_01, PB_00, "sd");
+//SDFileSystem sd(PB_03, PB_02, PB_01, PB_00, "sd");
+Serial uart1(PA_13,PA_14);
+int main() {
+    uart1.printf("Hello World!\n");   
+ 
+    mkdir("/sd/mydir", 0777);
+    
+    FILE *fp = fopen("/sd/mydir/sdtest.txt", "w");
+    if(fp == NULL) {
+        error("Could not open file for write\n");
+    }
+    fprintf(fp, "Hello fun SD1 Card World!");
+    fclose(fp); 
+ 
+    uart1.printf("Goodbye World!\n");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Jul 15 01:21:28 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/aae6fcc7d9bb
\ No newline at end of file