Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SDFileSystem mbed
Revision 0:4f476bcbfc58, committed 2016-10-17
- Comitter:
- igorsilvati
- Date:
- Mon Oct 17 15:54:54 2016 +0000
- Commit message:
- MMMMM
Changed in this revision
--- /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