Seeed Studio SD card V4.0 shield with the Freescale KL25Z platform.

Dependencies:   SDFileSystem mbed

Fork of SDFileSystem_HelloWorld by mbed official

Revision:
1:63277c702117
Parent:
0:bdbd3d6fc5d5
--- a/main.cpp	Fri Dec 07 11:25:01 2012 +0000
+++ b/main.cpp	Thu Oct 24 08:59:14 2013 +0000
@@ -1,19 +1,32 @@
 #include "mbed.h"
 #include "SDFileSystem.h"
  
-SDFileSystem sd(p5, p6, p7, p8, "sd"); // the pinout on the mbed Cool Components workshop board
+/*
+FRDM KL25Z with Seeed SD Card Shield V4
+Connections have to be added between the SD Card Shield
+digital connector pins and the SPI connector pins as follows:
+Signal  Digital SPI
+MOSI    D11     4
+MISO    D12     1
+SCK     D13     3
+/CS     D4
+*/
+
+//SDFileSystem sd(PTD2, PTD3, PTD1, PTA4, "sd"); // MOSI, MISO, SCK, CS
+SDFileSystem sd(D11, D12, D13, D4, "sd"); // MOSI, MISO, SCK, CS
+Serial pc(USBTX, USBRX);
  
 int main() {
-    printf("Hello World!\n");   
+    pc.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");
+        pc.printf("Could not open file for write\n");
     }
     fprintf(fp, "Hello fun SD Card World!");
     fclose(fp); 
  
-    printf("Goodbye World!\n");
+    pc.printf("Goodbye World!\n");
 }