acd52832_buzzer example

Dependencies:   BuzzerLib mbed

Files at this revision

API Documentation at this revision

Comitter:
jurica238814
Date:
Tue Sep 20 10:11:25 2016 +0000
Commit message:
acd52832_buzzer;

Changed in this revision

BuzzerLib.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r c20182d53ef0 BuzzerLib.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/BuzzerLib.lib	Tue Sep 20 10:11:25 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/adelino/code/BuzzerLib/#b0c0c7d002aa
diff -r 000000000000 -r c20182d53ef0 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Sep 20 10:11:25 2016 +0000
@@ -0,0 +1,23 @@
+
+
+
+#include "mbed.h"
+#include "Buzzer.h"
+
+//char *song = "The Simpsons:d=4,o=5,b=160:c.6,e6,f#6,8a6,g.6,e6,c6,8a,8f#,8f#,8f#,2g,8p,8p,8f#,8f#,8f#,8g,a#.,8c6,8c6,8c6,c6";
+//char *song = "Xfiles:d=4,o=5,b=125:e,b,a,b,d6,2b.,1p,e,b,a,b,e6,2b.,1p,g6,f#6,e6,d6,e6,2b.,1p,g6,f#6,e6,d6,f#6,2b.,1p,e,b,a,b,d6,2b.,1p,e,b,a,b,e6,2b.,1p,e6,2b.";
+char *song = "smb:d=4,o=5,b=100:16e6,16e6,32p,8e6,16c6,8e6,8g6,8p,8g,8p,8c6,16p,8g,16p,8e,16p,8a,8b,16a#,8a,16g.,16e6,16g6,8a6,16f6,8g6,8e6,16c6,16d6,8b,16p,8c6,16p,8g,16p,8e,16p,8a,8b,16a#,8a,16g.,16e6,16g6,8a6,16f6,8g6,8e6,16c6,16d6,8b,8p,16g6,16f#6,16f6,16d#6,16p,16e6,16p,16g#,16a,16c6,16p,16a,16c6,16d6,8p,16g6,16f#6,16f6,16d#6,16p,16e6,16p,16c7,16p,16c7,16c7,p,16g6,16f#6,16f6,16d#6,16p,16e6,16p,16g#,16a,16c6,16p,16a,16c6,16d6,8p,16d#6,8p,16d6,8p,16c6";
+
+Buzzer buzzer(p31);
+
+Music* pMusic=0;    //the song
+Note la("A#4",50);  //the sound
+
+int main()
+{
+   pMusic= new Music(song);
+   pMusic->play(&buzzer);
+   
+   buzzer.tone(&la);
+   delete(pMusic);
+}
\ No newline at end of file
diff -r 000000000000 -r c20182d53ef0 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Sep 20 10:11:25 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/abea610beb85
\ No newline at end of file