Write 10 lines of Accelerometer data from FRDM-KL25Z to SD Card and read it back.

Dependencies:   MMA8451Q SDFileSystem mbed

Fork of SDCardTest by Orko Garai

main.cpp

Committer:
simon
Date:
2009-12-31
Revision:
3:68ef62208d4d
Parent:
1:2dec995d53f8
Child:
4:823307a8e5dc

File content as of revision 3:68ef62208d4d:

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

SDFileSystem sd(p11, p12, p13, p27, "sd");

int main() {
    printf("Hello World!\n");   

    FILE *fp = fopen("/sd/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");
}