CORE / Mbed 2 deprecated Sample_microSD

Dependencies:   SDFileSystem mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 /*
00002 説明
00003 Nucleo-F303K8とMicroSDを使ったデータ保存のサンプルプログラム
00004 
00005 以下ピン配置
00006 Nucleo  SDモジュール
00007 GND-----VSS-----------0V
00008 +3V3----VDD
00009 D11-----CMD
00010 D12-----DAT0
00011 D13-----CLK
00012 D9------CD
00013 */
00014 
00015 #include "mbed.h"
00016 #include "SDFileSystem.h"
00017  
00018 SDFileSystem sd(D11, D12, D13, D9, "sd"); // the pinout on the mbed Cool Components workshop board
00019  
00020 int main() {    
00021     FILE *fp = fopen("/sd/sdtest.txt", "w");
00022     fprintf(fp, "HelloWorld!");
00023     fclose(fp); 
00024     free(fp);
00025 }