Killian Spain
/
INST8100_Lab04
main.cpp
- Committer:
- t00221549
- Date:
- 2021-08-08
- Revision:
- 0:df543f411aab
File content as of revision 0:df543f411aab:
#include "mbed.h" DigitalIn fire(p14); PwmOut spkr(p26); AnalogIn pot1(p19); float start=2000; float finish=10000; float step=200; int main() { while (1) { for (float i=start; i<finish; i+=step) { spkr.period(1.0/i); spkr=0.5; wait(0.1); } spkr=0.0; start += 1000; if (start >= 6000){ start = 6000; } while(pot1.read() < 0.5) {} // this uses the pot to control the program } }