Demo for new class to play a note on a speaker using a PWM output See http://mbed.org/users/4180_1/notebook/using-a-speaker-for-audio-output/
Revision 2:68eee0fb2026, committed 2014-10-21
- Comitter:
- 4180_1
- Date:
- Tue Oct 21 03:14:51 2014 +0000
- Parent:
- 0:b2fdf3770282
- Commit message:
- ver 1.1
Changed in this revision
| Speaker.h | 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 |
--- a/Speaker.h Sun Jan 20 03:02:37 2013 +0000
+++ b/Speaker.h Tue Oct 21 03:14:51 2014 +0000
@@ -1,5 +1,5 @@
#include "mbed.h"
-// new class to play a note on Speaker based on PwmOut class
+// a new class to play a note on Speaker based on PwmOut class
class Speaker
{
public:
--- a/main.cpp Sun Jan 20 03:02:37 2013 +0000
+++ b/main.cpp Tue Oct 21 03:14:51 2014 +0000
@@ -3,7 +3,7 @@
// Speaker test program - euro police style siren now using new Speaker class method
// for documentation see http://mbed.org/users/4180_1/notebook/using-a-speaker-for-audio-output/
-// can also be used to play a song, if you have the notes and durations
+// can also be used to play a song, if you have all of the notes and durations
// for musical note frequencies see http://en.wikipedia.org/wiki/Piano_key_frequencies
int main()
@@ -17,3 +17,4 @@
mySpeaker.PlayNote(800.0,0.5,0.5);
}
}
+