SONIDOS

Dependencies:   mbed wave_player SDFileSystem

main.cpp

Committer:
chessdsbr
Date:
2020-06-08
Revision:
2:f4ea87b08d77
Parent:
0:bdbd3d6fc5d5

File content as of revision 2:f4ea87b08d77:

#include "mbed.h"
#include "SDFileSystem.h"
 
SDFileSystem sd(D11, D12, D13, D10, "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");
}