SoundWaveGenerator test bed

Dependencies:   SoundWaveGenerator mbed

Files at this revision

API Documentation at this revision

Comitter:
osmeest
Date:
Mon Jan 24 22:45:01 2011 +0000
Commit message:

Changed in this revision

SoundWaveGenerator.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 9027b50b2ced SoundWaveGenerator.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SoundWaveGenerator.lib	Mon Jan 24 22:45:01 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/osmeest/code/SoundWaveGenerator/#ed89ef772e92
diff -r 000000000000 -r 9027b50b2ced main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Jan 24 22:45:01 2011 +0000
@@ -0,0 +1,35 @@
+#include "mbed.h"
+#include "snd_wave_generator/SoundWaveGenerator.h"
+#include "snd_wave_generator/TriangleWave.h"
+#include "snd_wave_generator/SineWave.h"
+#include "snd_wave_generator/WaveCombo.h"
+
+using namespace snd_wave_generator;
+
+int main() {
+    SineWave sw(440);
+    TriangleWave tw(1000);
+    WaveCombo cw;
+    cw.add(&sw).add(&tw);
+    SoundWaveGenerator generator(16000);
+    
+    BusOut leds(LED1, LED2, LED4);
+
+    while(1) {
+        leds = 1;
+        generator.play(&sw);
+        wait(1);
+        leds = 4;
+        generator.stop();
+        wait(0.2);
+        leds = 2;
+        generator.play(&tw);
+        wait(1);
+        leds = 3;
+        generator.play(&cw);
+        wait(1);
+        leds = 4;
+        generator.stop();
+        wait(2);
+    }
+}
diff -r 000000000000 -r 9027b50b2ced mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Jan 24 22:45:01 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e