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.
Fork of FRDM_K64F-SDCard by
main.cpp
- Committer:
- maclobdell
- Date:
- 2016-09-09
- Revision:
- 3:2bdf02873657
- Parent:
- 1:97116c4ac649
File content as of revision 3:2bdf02873657:
/* ******************************************************************************* * HTTP://WWW.CERESCONTROLS.COM * PANAMÁ, REPÚBLICA DE PANAMÁ * * File : main.cpp * Programer(s) : Rangel Alvarado * Language : C/C++ * Description : Simple SD Card File System Write * * Notes : Using standard mbed classes to write information data in * the SD Card. * http://cache.freescale.com/files/32bit/doc/user_guide/FRDMK64FUG.pdf * ******************************************************************************* */ #include "mbed.h" // mbed application libraries #include "libraries/fs/sd/SDFileSystem.h" // SD File System functions #define DAT0 PTE3 // MOSI #define CMD PTE1 // MISO #define CLK PTE2 // SCLK #define CD PTE4 // CS SDFileSystem sd(DAT0, CMD, CLK, CD, "sd"); // MOSI, MISO, SCLK, CS Serial pc(USBTX, USBRX); // Virtual COM Port int main() { FILE *File = fopen("/sd/sdfile2.txt", "w"); // open file if(File == NULL) { // check if present pc.printf("No SD Card or bad format\n"); // print message } else { // otherwise pc.printf("Ready to write\n"); // message preparing to write } fprintf(File, "Hexiwear"); // write data fclose(File); // close file on SD }