Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SDFileSystem mbed
Revision 1:a8cfc313a2ae, committed 2016-06-28
- 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 |
--- 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);