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
Fork of STMNucleoF401RE_ExampleCode_04_SDcard_Fi by
Diff: main.cpp
- Revision:
- 2:09d6c35ac28c
- Parent:
- 0:4860a91fb495
- Child:
- 3:221bcfbe120b
--- a/main.cpp Mon Feb 17 22:16:24 2014 +0000 +++ b/main.cpp Mon Nov 02 13:49:32 2015 +0000 @@ -1,18 +1,19 @@ -#include "mbed.h" +/**************************************************** +* FAST PROTOTYPING WITH NUCLEO * +* Example Code 04: SDcard * +* Author: Mauro D'Angelo * +* Organization: Perlatecnica no-profit organization * +*****************************************************/ -PwmOut mypwm(PWM_OUT); +#include "mbed.h" +#include "SDFileSystem.h" -DigitalOut myled(LED1); +SDFileSystem sd(D11, D12, D13, D4, "sd");// MOSI, MISO, SCK, CS int main() { - - mypwm.period_ms(10); - mypwm.pulsewidth_ms(1); - - printf("pwm set to %.2f %%\n", mypwm.read() * 100); - - while(1) { - myled = !myled; - wait(1); - } + FILE *fd = fopen("/sd/mbed.txt","w"); + fprintf(fd,"Welcome SD!!\n"); + fclose(fd); } + +// mkdir("/sd/log", 0777); \ No newline at end of file