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 wave_player SDFileSystem TextLCD
main.cpp
00001 #include "mbed.h" 00002 #include "TextLCD.h" 00003 #include "SDFileSystem.h" 00004 #include "wave_player.h" 00005 00006 00007 00008 AnalogOut DACout(PTE30); 00009 wave_player waver(&DACout); 00010 SDFileSystem sd(PTD2, PTD3, PTD1, PTD0, "sd"); // Pines del modulo sd 00011 00012 00013 Serial pc (USBTX,USBRX);// Comunicacion serial con el pc 00014 float p,q,w; 00015 int sel; 00016 00017 00018 void receivedByte()// Interrupcion pc 00019 { 00020 int byteReceived = pc.getc();//Variable que viene del pc 00021 00022 switch (byteReceived) { 00023 00024 case 'x' :// Segunda etapa: Primera terapia calma -.- 00025 sel=1; 00026 00027 break; 00028 00029 00030 } 00031 } 00032 00033 int main() 00034 { 00035 00036 pc.baud(9600); 00037 pc.attach(&receivedByte); 00038 00039 00040 00041 FILE *wave_file; 00042 while(1) { 00043 if (sel == 1) { 00044 00045 wave_file = fopen("/sd/AUDIO.wav", "r"); 00046 waver.play(wave_file); 00047 fclose(wave_file); 00048 } 00049 00050 } 00051 }
Generated on Sun Jul 24 2022 20:33:26 by
1.7.2