Phi Nguyen
/
app-board-Speaker
My change.
Fork of app-board-Speaker by
Diff: main.cpp
- Revision:
- 3:00613a6b0e8b
- Parent:
- 2:cfd337edff08
--- a/main.cpp Thu Oct 25 12:25:00 2012 +0000 +++ b/main.cpp Wed Mar 05 03:49:12 2014 +0000 @@ -2,12 +2,14 @@ DigitalIn fire(p14); PwmOut spkr(p26); +float theta = 0; int main() { while (1) { - for (float i=2000.0; i<10000.0; i+=100) { - spkr.period(1.0/i); + for (float i=2000.0; i>0.0; i+=100) { + theta += .2; + spkr.period(sin(theta)/1000); spkr=0.5; wait(0.1); }