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: RTC_Reader SDFileSystem DS3231
main.cpp
- Committer:
- DimasFN
- Date:
- 2018-11-16
- Revision:
- 0:eb4606c99ae9
- Child:
- 1:cd725fbbcbc2
File content as of revision 0:eb4606c99ae9:
//https://os.mbed.com/users/neilt6/code/SDFileSystem_HelloWorld/
#include "mbed.h"
#include "SDFileSystem.h"
//SDFileSystem::SDFileSystem(PinName mosi, PinName miso, PinName sclk, PinName cs, const char* name) :
SDFileSystem sd(D11, D12, D13, D10, "G"); // the pinout on the mbed Cool Components workshop board
int main() {
printf("SD card test!\r\n");
mkdir("/G/mydir", 0777);
FILE *fp = fopen("/G/mydir/TEST.txt", "w");
if(fp == NULL) {
error("Could not open file for write\r\n");
}
fprintf(fp, "Hello fun SD Card World!\r\n");
fclose(fp);
printf("File successfully written and closed!\r\n");
}