2016年度 浅川さんのSDFileSystemテストプログラム

Dependencies:   SDFileSystem mbed

Fork of SDFileSystem_HelloWorld by mbed official

main.cpp

Committer:
asakawa
Date:
2016-09-02
Revision:
1:32a2be016fda
Parent:
0:bdbd3d6fc5d5

File content as of revision 1:32a2be016fda:

#include "mbed.h"
#include "SDFileSystem.h"
 
SDFileSystem sd(P8_5, P8_6, P8_3, P8_4, "sd"); // the pinout on the mbed Cool Components workshop board
 
int main() {
    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!");
    fclose(fp); 
 
    printf("Goodbye World!\n");
}