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
main.cpp@3:221bcfbe120b, 2016-10-19 (annotated)
- Committer:
- STmdangelo
- Date:
- Wed Oct 19 08:47:53 2016 +0000
- Revision:
- 3:221bcfbe120b
- Parent:
- 2:09d6c35ac28c
Updated Organization name
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
perlatecnica | 2:09d6c35ac28c | 1 | /**************************************************** |
perlatecnica | 2:09d6c35ac28c | 2 | * FAST PROTOTYPING WITH NUCLEO * |
perlatecnica | 2:09d6c35ac28c | 3 | * Example Code 04: SDcard * |
perlatecnica | 2:09d6c35ac28c | 4 | * Author: Mauro D'Angelo * |
STmdangelo | 3:221bcfbe120b | 5 | * Organization: STMicroelectronics * |
perlatecnica | 2:09d6c35ac28c | 6 | *****************************************************/ |
bcostm | 0:4860a91fb495 | 7 | |
perlatecnica | 2:09d6c35ac28c | 8 | #include "mbed.h" |
perlatecnica | 2:09d6c35ac28c | 9 | #include "SDFileSystem.h" |
bcostm | 0:4860a91fb495 | 10 | |
perlatecnica | 2:09d6c35ac28c | 11 | SDFileSystem sd(D11, D12, D13, D4, "sd");// MOSI, MISO, SCK, CS |
bcostm | 0:4860a91fb495 | 12 | |
bcostm | 0:4860a91fb495 | 13 | int main() { |
perlatecnica | 2:09d6c35ac28c | 14 | FILE *fd = fopen("/sd/mbed.txt","w"); |
perlatecnica | 2:09d6c35ac28c | 15 | fprintf(fd,"Welcome SD!!\n"); |
perlatecnica | 2:09d6c35ac28c | 16 | fclose(fd); |
bcostm | 0:4860a91fb495 | 17 | } |
perlatecnica | 2:09d6c35ac28c | 18 | |
perlatecnica | 2:09d6c35ac28c | 19 | // mkdir("/sd/log", 0777); |