Example program to do a frequency sweep on the speaker

Dependencies:   mbed

Fork of app-board-Speaker by Chris Styles

Files at this revision

API Documentation at this revision

Comitter:
chris
Date:
Thu Feb 06 15:49:16 2014 +0000
Parent:
2:cfd337edff08
Child:
4:b141db62c34a
Commit message:
First check in

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu Oct 25 12:25:00 2012 +0000
+++ b/main.cpp	Thu Feb 06 15:49:16 2014 +0000
@@ -1,7 +1,7 @@
 #include "mbed.h"
 
-DigitalIn fire(p14);
-PwmOut spkr(p26);
+DigitalIn fire(D4);
+PwmOut spkr(D6);
 
 int main()
 {
@@ -9,7 +9,7 @@
         for (float i=2000.0; i<10000.0; i+=100) {
             spkr.period(1.0/i);
             spkr=0.5;
-            wait(0.1);
+            wait(0.02);
         }
         spkr=0.0;
         while(!fire) {}