sasa

Dependencies:   SDFileSystem mbed

Files at this revision

API Documentation at this revision

Comitter:
igorsilvati
Date:
Mon Oct 17 15:54:54 2016 +0000
Commit message:
MMMMM

Changed in this revision

CartaoSD.cpp Show annotated file Show diff for this revision Revisions of this file
CartaoSD.h Show annotated file Show diff for this revision Revisions of this file
SDFileSystem.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CartaoSD.cpp	Mon Oct 17 15:54:54 2016 +0000
@@ -0,0 +1,20 @@
+#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");
+}
+    
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CartaoSD.h	Mon Oct 17 15:54:54 2016 +0000
@@ -0,0 +1,20 @@
+#include "mbed.h"
+#include "SDFileSystem.h"
+class CartaoSD
+{
+    
+    static const PinName Mosi = PTD2; 
+    static const PinName Miso= PTD3;  
+    static const PinName Sclk = PTD1; 
+    static const PinName Cs= PTD0;
+    
+    
+    SDFileSystem _sd;
+    
+    public: 
+    CartaoSD();
+    ~CartaoSD();
+    
+    void gravarSD();
+    
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SDFileSystem.lib	Mon Oct 17 15:54:54 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbotkinl/code/SDFileSystem/#7b35d1709458
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Oct 17 15:54:54 2016 +0000
@@ -0,0 +1,12 @@
+#include "mbed.h"
+
+DigitalOut myled(LED1);
+
+int main() {
+    while(1) {
+        myled = 1;
+        wait(0.2);
+        myled = 0;
+        wait(0.2);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Oct 17 15:54:54 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/25aea2a3f4e3
\ No newline at end of file