sasa

Dependencies:   SDFileSystem mbed

CartaoSD.cpp

Committer:
igorsilvati
Date:
2016-10-17
Revision:
0:4f476bcbfc58

File content as of revision 0:4f476bcbfc58:

#include "CartaoSD.h"
#include "mbed.h"
#include "SDFileSystem.h"

CartaoSD::CartaoSD():_sd(CartaoSD::Mosi, CartaoSD::Miso, CartaoSD::Sclk, CartaoSD::Cs, "aa"){}
void gravarSD(){
    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");
}