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 mbed-rtos 4DGL-uLCD-SE RTOS FATFileSystem
Revision 11:50e44c84411c, committed 2018-02-20
- Comitter:
- 4180_1
- Date:
- Tue Feb 20 17:54:41 2018 +0000
- Parent:
- 10:21943bd35341
- Child:
- 12:0fe16c716237
- Commit message:
- ver 1.0
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FATFileSystem.lib Tue Feb 20 17:54:41 2018 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/teams/mbed-official/code/FATFileSystem/#28e685e5ff7f
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SDFileSystem.lib Tue Feb 20 17:54:41 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/4180_1/code/SDFileSystem/#42e77fa78bf5
--- a/USBHost.lib Fri Dec 05 18:16:56 2014 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -https://mbed.org/users/mbed_official/code/USBHost/#37c948cf0dbf
--- a/main.cpp Fri Dec 05 18:16:56 2014 +0000
+++ b/main.cpp Tue Feb 20 17:54:41 2018 +0000
@@ -1,6 +1,11 @@
#include "mbed.h"
-#include "USBHostMSD.h"
+#include "rtos.h"
+#include "SDFileSystem.h"
#include "wave_player.h"
+
+
+SDFileSystem sd(p5, p6, p7, p8, "sd"); //SD card
+
//LED lighting effects with sound using the RTOS
//Plays the wave file "sample.wav" on the USB flash drive
//using waveplayer code library
@@ -142,26 +147,20 @@
}
}
-//wave player plays a *.wav file to D/A and a PWM
-wave_player waver(&DACout,&PWMout);
+//wave player plays a *.wav file to D/A
+wave_player waver(&DACout);
int main()
{
- USBHostMSD msd("usb");
+
FILE *wave_file;
- //setup PWM hardware for a Class D style audio output
- PWMout.period(1.0/400000.0);
- // wait until connected to a USB device
- while(!msd.connect()) {
- Thread::wait(750);
- }
while(1) {
{
//Lighthouse demo with foghorn
Thread thread(lighthouse); //Start LED effect thread
for(int i=0; i<4; ++i) {
//open wav file and play it
- wave_file=fopen("/usb/foghorn.wav","r");
+ wave_file=fopen("/sd/foghorn.wav","r");
waver.play(wave_file); //Plays (*.wav file
fclose(wave_file);
Thread::wait(1925);
@@ -174,7 +173,7 @@
//Arc Welding with sound
Thread thread(welding);
//open wav file and play it
- wave_file=fopen("/usb/welding.wav","r");
+ wave_file=fopen("/sd/welding.wav","r");
waver.play(wave_file);
fclose(wave_file);
//end of welding demo;
@@ -185,7 +184,7 @@
//code block forces thread out of scope
Thread thread(police);
//open wav file and play it
- wave_file=fopen("/usb/emgsiren.wav","r");
+ wave_file=fopen("/sd/emgsiren.wav","r");
waver.play(wave_file);
fclose(wave_file);
//end of police light demo;
@@ -195,7 +194,7 @@
//Fire with sound
Thread thread(fire);
//open wav file and play it
- wave_file=fopen("/usb/fire.wav","r");
+ wave_file=fopen("/sd/fire.wav","r");
waver.play(wave_file);
fclose(wave_file);
//end of fire demo;
@@ -206,7 +205,7 @@
//RR Crossing Lights with Signal Bells
Thread thread(rrcrossing);
//open wav file and play it
- wave_file=fopen("/usb/SignalBell.wav","r");
+ wave_file=fopen("/sd/SignalBell.wav","r");
waver.play(wave_file);
fclose(wave_file);
//end of railroad crossing demo;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-rtos.lib Tue Feb 20 17:54:41 2018 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/mbed_official/code/mbed-rtos/#5713cbbdb706
--- a/mbed.bld Fri Dec 05 18:16:56 2014 +0000 +++ b/mbed.bld Tue Feb 20 17:54:41 2018 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/f37f3b9c9f0b \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/5571c4ff569f \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wave_player.lib Tue Feb 20 17:54:41 2018 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/sravet/code/wave_player/#acc3e18e77ad
--- a/wave_player_appbd.lib Fri Dec 05 18:16:56 2014 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -http://mbed.org/users/4180_1/code/wave_player_appbd/#b1cea7afcfd2