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: mbed SDFileSystem
main.cpp
- Committer:
- RyusukeIwata
- Date:
- 2021-08-03
- Revision:
- 0:2bb0ef17ab94
File content as of revision 0:2bb0ef17ab94:
#include "mbed.h"
#include "SDFileSystem.h"
Serial pc(USBTX, USBRX);
SDFileSystem sd(D11, D12, D13, D9, "sd");
int main()
{
pc.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!ryusuke");
fclose(fp);
pc.printf("Goodbye World!\n");
}