asd

Dependencies:   SDFileSystem mbed

Fork of SDFileSystem_HelloWorld by mbed official

SD card write - fat file system kl46z

main.cpp

Committer:
fblanc92
Date:
2017-08-23
Revision:
2:8a7953dfeccd
Parent:
0:bdbd3d6fc5d5
Child:
3:b2658ae9fc38

File content as of revision 2:8a7953dfeccd:

#include "mbed.h"
#include "SDFileSystem.h"
SDFileSystem sd(PTA16,PTA17,PTA15,PTA14, "sd"); // the pinout on the mbed Cool Components workshop board
DigitalOut redLed(LED2);
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");

}