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: MPU6050_SIM5320_TEST SDFileSystem WakeUp
Fork of Nucleo_L476RG_SDCard_WorkingSample by
Diff: main.cpp
- Revision:
- 0:fdd58267bc13
- Child:
- 1:d5774258d18b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Fri Apr 07 10:33:54 2017 +0000
@@ -0,0 +1,34 @@
+#include "mbed.h"
+#include "SDFileSystem.h"
+//Nucleo L476RG_SDCARD test
+
+
+
+/* SD: Description nucleo PINNR (from top to down of the right-connector-left pins):
+ 1 CS PB_6 9
+ 2 MOSI PA_7 8
+ 3 GND GND
+ 4 3.3V 3.3V
+ 5 SCLK PA_5 6
+ 6 -
+ 7 MISO PA_6 7
+ 8
+
+*/
+// MOSI, MISO, SCLK, CS, name
+SDFileSystem sd(PA_7, PA_6, PA_5, PB_6, "sd");
+
+
+int main() {
+ printf("\nWait for new connection...\n");
+
+ mkdir("/sd/mydir", 0777);
+ printf("\nDirectory created\n");
+ FILE *fp = fopen("/sd/mydir/sdtest.txt", "w");
+ if(fp == NULL) {
+ printf("Could not open file for write\n");
+ }
+ fprintf(fp, "Hello fun SD Card World!");
+ fclose(fp);
+ printf("Text written to the SD-CARD\n");
+}
