![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Clock
Dependencies: 4DGL-uLCD-SE EthernetInterface NTPClient TextLCD mbed PinDetect SDFileSystem wave_player mbed-rtos
Fork of Internet_LCD_Clock by
Revision 6:e08b5dbdfbcf, committed 2016-04-22
- Comitter:
- ashea6
- Date:
- Fri Apr 22 16:02:12 2016 +0000
- Parent:
- 5:818735a07b88
- Commit message:
- dkdkdkd
Changed in this revision
diff -r 818735a07b88 -r e08b5dbdfbcf Internet_LCD_Clock.cpp --- a/Internet_LCD_Clock.cpp Wed Apr 20 20:28:20 2016 +0000 +++ b/Internet_LCD_Clock.cpp Fri Apr 22 16:02:12 2016 +0000 @@ -3,7 +3,7 @@ #include "NTPClient.h" #include "EthernetInterface.h" #include "uLCD_4DGL.h" -#include "Speaker.h" +//#include "Speaker.h" #include "SDFileSystem.h" #include "wave_player.h" #include "PinDetect.h" @@ -42,7 +42,7 @@ bool playing = false; bool sd_insert = false; static int veclen = 5; -FILE *wave_file; +//FILE *wave_file; //variables for alarm //system time structure time_t ctTime; //ctTime = current time @@ -117,15 +117,10 @@ //Play file from SD card void play_file() { - bool* play_point = &playing; - //string file_name("/sd/"); - //file_name += filenames[current]; - // wave_file = fopen(file_name.c_str(),"r"); + FILE *wave_file; + printf("\n\n\nHello, wave world!\n"); wave_file=fopen("/sd/bob.wav","r"); - while(playing) { - waver.play(wave_file, play_point); - // mySpeaker.PlaySong(note,duration); - } + waver.play(wave_file); fclose(wave_file); } @@ -169,7 +164,7 @@ int main() { - + play_file(); snooze.mode(PullUp); off.mode(PullUp); wait(0.01);
diff -r 818735a07b88 -r e08b5dbdfbcf Speaker.h --- a/Speaker.h Wed Apr 20 20:28:20 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -#include "mbed.h" -// new class to play a note on Speaker based on PwmOut class -class Speaker -{ -public: - Speaker(PinName pin) : _pin(pin) { -// _pin(pin) means pass pin to the Speaker Constructor - } -// class method to play a note based on PwmOut class - void PlayNote(float frequency, float duration, float volume) { - _pin.period(1.0/frequency); - _pin = volume/2.0; - wait(duration); - _pin = 0.0; - } - -private: - PwmOut _pin; -}; \ No newline at end of file
diff -r 818735a07b88 -r e08b5dbdfbcf wave_player.lib --- a/wave_player.lib Wed Apr 20 20:28:20 2016 +0000 +++ b/wave_player.lib Fri Apr 22 16:02:12 2016 +0000 @@ -1,1 +1,1 @@ -https://developer.mbed.org/teams/4180/code/wave_player/#ab8c3f888b64 +http://mbed.org/users/sravet/code/wave_player/#acc3e18e77ad