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: fat mbed SDFileSystem
main.cpp
00001 #include "mbed.h" 00002 #include "rtos.h" 00003 #include "SDFileSystem.h" 00004 00005 DigitalOut led1(LED1); 00006 DigitalOut led2(LED2); 00007 00008 void sd_thread(void const *argument) { 00009 SDFileSystem sd(p5, p6, p7, p8, "sd"); 00010 FILE *f = fopen("/sd/out.txt", "w"); 00011 for (int i=0; i<30; i++) { 00012 fprintf(f, "%d\n", i); 00013 printf("%d\n\r", i); 00014 } 00015 printf("closing\n"); 00016 fclose(f); 00017 00018 while (true) { 00019 led2 = !led2; 00020 Thread::wait(1000); 00021 } 00022 } 00023 00024 int main() { 00025 Thread t(sd_thread, NULL, osPriorityNormal, (DEFAULT_STACK_SIZE * 2.25)); 00026 00027 while (true) { 00028 led1 = !led1; 00029 Thread::wait(1000); 00030 } 00031 }
Generated on Sat Jul 16 2022 21:50:31 by
1.7.2