Phi Nguyen
/
app-board-Speaker
My change.
Fork of app-board-Speaker by
main.cpp
- Committer:
- 209108
- Date:
- 2014-03-05
- Revision:
- 3:00613a6b0e8b
- Parent:
- 2:cfd337edff08
File content as of revision 3:00613a6b0e8b:
#include "mbed.h" DigitalIn fire(p14); PwmOut spkr(p26); float theta = 0; int main() { while (1) { for (float i=2000.0; i>0.0; i+=100) { theta += .2; spkr.period(sin(theta)/1000); spkr=0.5; wait(0.1); } spkr=0.0; while(!fire) {} } }