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 mbed-rtos 4DGL-uLCD-SE HC_SR04_Ultrasonic_Library
Diff: main.cpp
- Revision:
- 7:85d42006e380
- Parent:
- 6:068146497fe6
- Child:
- 8:c0a6a3363e43
--- a/main.cpp Wed Apr 22 04:33:06 2020 +0000 +++ b/main.cpp Wed Apr 22 17:30:31 2020 +0000 @@ -17,7 +17,8 @@ DigitalOut shdn(p26); RawSerial BT(p9,p10); //Serial BT(p9,p10); - +AnalogOut speaker(p18); //NEW +wave_player waver(&speaker);//NEW Mutex mutex; DigitalOut MyLED(LED1); @@ -67,10 +68,23 @@ int main() { + //NEW + uLCD.cls(); + uLCD.baudrate(BAUD_3000000); + //wait(1.0); + + //blu.attach(&parse_message,Serial::RxIrq); + //Was used to interupt if reading in a blutooth command + //Thread t#(name_of_thread_function); - MyLED = 0; - while(1){ - MyLED = !MyLED; - wait(.1); - } + + FILE *wave_file; + //printf("Hello World"); + Thread::wait(1000); + wave_file=fopen("/sd/test.wav","r"); + //serial_mutex.lock(); + if(wave_file==NULL) printf("file open error!\n\n\r"); + //serial_mutex.unlock(); + waver.play(wave_file); + fclose(wave_file); } \ No newline at end of file