wave_player library problems
Dependencies: 4DGL-uLCD-SE EthernetInterface NTPClient PinDetect SDFileSystem mbed-rtos mbed wave_player
Fork of 4180_Final_Project by
Revision 6:8e926bbfaec0, committed 2016-04-22
- Comitter:
- ashea6
- Date:
- Fri Apr 22 17:59:29 2016 +0000
- Parent:
- 5:3c880df67e2e
- Commit message:
- wave player probs
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
wave_player.lib | Show annotated file Show diff for this revision Revisions of this file |
diff -r 3c880df67e2e -r 8e926bbfaec0 main.cpp --- a/main.cpp Fri Apr 22 17:38:25 2016 +0000 +++ b/main.cpp Fri Apr 22 17:59:29 2016 +0000 @@ -41,6 +41,7 @@ // Current alarm time int curAlarmHour = 18; //0-23 int curAlarmMin = 9; +bool play = true; //time thread void time_thread(void const *args) @@ -61,6 +62,7 @@ void snooze_hit_callback (void) { myled1 = !myled1; + play = false; time_t newtime; struct tm * timeinfo; newtime = ct_time + snoozeTime; @@ -73,14 +75,18 @@ void off_hit_callback (void) { myled2 = !myled2; + play = false; + curAlarmMin = baseAlarmMin; + curAlarmHour = baseAlarmHour; } void play_file() { + bool* play_point = &play; FILE *wave_file; printf("\n\n\nHello, wave world!\n"); wave_file=fopen("/sd/bob.wav","r"); - waver.play(wave_file); + waver.play(wave_file, play_point); fclose(wave_file); } @@ -89,9 +95,9 @@ struct tm * timeinfo; timeinfo = localtime (&ct_time); if (timeinfo->tm_min == curAlarmMin && timeinfo->tm_hour == curAlarmHour) { - //playing = true; + play = true; + myled3 = true; play_file(); - myled3 = true; } } @@ -105,6 +111,7 @@ snooze.setSampleFrequency(); off.setSampleFrequency(); + play_file(); // Initialize LCD
diff -r 3c880df67e2e -r 8e926bbfaec0 wave_player.lib --- a/wave_player.lib Fri Apr 22 17:38:25 2016 +0000 +++ b/wave_player.lib Fri Apr 22 17:59:29 2016 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/sravet/code/wave_player/#acc3e18e77ad +https://developer.mbed.org/teams/4180/code/wave_player/#ab8c3f888b64