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.
main.cpp
00001 #include "mbed.h" 00002 00003 DigitalOut led1(LED1); 00004 DigitalOut led2(LED2); 00005 DigitalOut led3(LED3); 00006 DigitalOut led4(LED4); 00007 Ticker tick; 00008 LocalFileSystem sd("sd"); 00009 00010 void flash(void){ 00011 if (led1 == 1) 00012 led1 = 0; 00013 else 00014 led1=1; 00015 } 00016 00017 00018 int main() { 00019 00020 FILE* fp = fopen("/sd/test.wav","rb"); 00021 tick.attach_us(&flash, 1000); 00022 00023 while(1) { 00024 led2 = 1; 00025 wait_ms(1000); 00026 led2 = 0; 00027 00028 char* buffer; 00029 buffer = (char*)malloc(8000); 00030 00031 led3 = 1; 00032 wait_ms(1000); 00033 led3 = 0; 00034 00035 fread(buffer, 1, 8000, fp); 00036 00037 led4 = 1; 00038 wait_ms(1000); 00039 led4 = 0; 00040 } 00041 }
Generated on Sun Jul 17 2022 01:54:29 by
1.7.2