saving to SDcard

Dependencies:   mbed SDFileSystem

Files at this revision

API Documentation at this revision

Comitter:
RyusukeIwata
Date:
Tue Aug 03 07:12:36 2021 +0000
Commit message:
first commit;

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
diff -r 000000000000 -r 2bb0ef17ab94 SDFileSystem.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SDFileSystem.lib	Tue Aug 03 07:12:36 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/umezawa/code/SDFileSystem/#0524f79c18f3
diff -r 000000000000 -r 2bb0ef17ab94 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Aug 03 07:12:36 2021 +0000
@@ -0,0 +1,21 @@
+#include "mbed.h"
+#include "SDFileSystem.h"
+
+Serial pc(USBTX, USBRX);
+SDFileSystem sd(D11, D12, D13, D9, "sd");
+
+int main()
+{
+    pc.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 SD Card World!ryusuke");
+    fclose(fp);
+
+    pc.printf("Goodbye World!\n");
+}
diff -r 000000000000 -r 2bb0ef17ab94 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Aug 03 07:12:36 2021 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/mbed_official/code/mbed/builds/e1686b8d5b90
\ No newline at end of file