Use "MicroSD" by "STMF303K8" Nucleo-F303K8とmicroSDを使ったテキスト保存のサンプル

Dependencies:   SDFileSystem mbed

Files at this revision

API Documentation at this revision

Comitter:
mikawataru
Date:
Tue Jun 28 17:35:17 2016 +0000
Parent:
0:c23011e1cae6
Commit message:
mbed&SD

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r c23011e1cae6 -r a8cfc313a2ae main.cpp
--- a/main.cpp	Fri Jun 17 15:11:25 2016 +0000
+++ b/main.cpp	Tue Jun 28 17:35:17 2016 +0000
@@ -1,12 +1,27 @@
+/*
+説明
+Nucleo-F303K8とMicroSDを使ったデータ保存のサンプルプログラム
+
+以下ピン配置
+Nucleo  SDモジュール
+GND-----VSS-----------0V
++3V3----VDD
+D11-----CMD
+D12-----DAT0
+D13-----CLK
+D1------CD
+*/
+
+
 #include "mbed.h"
 #include "SDFileSystem.h"
 
-SDFileSystem sd()//MOSI, MISO, SCLK, SSEL
+SDFileSystem sd(D11, D12, D13, D1, "sd");//MOSI, MISO, SCLK, SSEL
 
 DigitalOut myled(LED1);
 
 int main() {
-    File *fp = fopen("/sd/test.txt", w);
+    FILE *fp = fopen("/sd/test.txt", "w");
     fprintf(fp,"HelloWorld\n");
     fclose(fp);
     free(fp);