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 PowerControl SDFileSystem
Fork of SDFilesystem by
main.cpp
00001 #include "mbed.h" 00002 #include "SDFileSystem.h" 00003 00004 Serial pc(USBTX,USBRX); 00005 SDFileSystem sd(p11, p12, p13, p15, "sd"); 00006 00007 int main() { 00008 pc.baud(9600); 00009 pc.printf("Hello world!\r\n"); 00010 char str[100]; 00011 mkdir("/sd/mydir", 0777); 00012 printf("helloworld\r\n"); 00013 FILE *fp = fopen("/sd/mydir/sdtest.txt","w"); 00014 if(fp == NULL) { 00015 error("Could not open file for write\r\n"); 00016 } 00017 for(int i=0;i<10;i++)fprintf(fp,"Hello my name is HEPTA!\r\n"); 00018 fclose(fp); 00019 fp = fopen("/sd/mydir/sdtest.txt","r"); 00020 fgets(str,100,fp); 00021 puts(str); 00022 fclose(fp); 00023 printf("Goodbye!!\r\n"); 00024 }
Generated on Fri Jul 15 2022 08:06:17 by
1.7.2
