Escritura SD USB

Dependencies:   mbed

Fork of FileSys-MultiFileSystem by David Smart

Revision:
0:22a5db2c7926
Child:
2:c887cf1c3ed9
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Jul 23 09:35:54 2012 +0000
@@ -0,0 +1,39 @@
+#include "mbed.h"
+#include "MSCFileSystem.h"
+
+MSCFileSystem sd("sd");
+
+
+DigitalOut led1(LED1);
+DigitalOut led2(LED2);
+DigitalOut led3(LED3);
+DigitalOut led4(LED4);
+
+int main() {
+
+    printf("This is version 1.0 of the USB host test\n");
+
+    FILE *fp = fopen("/sd/test.txt","w");
+    printf("Create filehandle\n");
+
+    led1= 1;
+
+    if (fp == NULL) {                 //make sure it's been opened
+        printf("its bad :-(\n");
+        led2 = 1;
+        exit(1);
+    }
+    printf("its good :-)\n");
+
+    led3 = 1;
+
+    fprintf(fp,"Hello world!\n");
+    printf("Write to the file\n");
+
+
+    fclose(fp);
+    printf("Close the handle\n");
+
+    led4 = 1;
+    printf("\n");
+}