weeeweeereree
Dependencies: PWM_Tone_Library mbed
Fork of PiezoBuzzer_HelloWorld_WIZwiki-W7500 by
Diff: main.cpp
- Revision:
- 1:e3fe34d2f61b
- Parent:
- 0:9d311e74ad13
--- a/main.cpp Fri Jul 24 05:12:14 2015 +0000 +++ b/main.cpp Fri Jun 15 07:22:51 2018 +0000 @@ -6,6 +6,7 @@ /* Private define ------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ PwmOut Buzzer(D5); +DigitalIn IR(D6); float C_3 = 1000000/Do3, Cs_3 = 1000000/Do3s, @@ -64,10 +65,16 @@ wait_ms(250); int i; + while(1){ + int ir = IR.read(); + if(ir == 0){ for(i=0; i<tones_num; i++) { Auto_tunes(Buzzer, tones[i], 4); // Auto performance Stop_tunes(Buzzer); } + } + +} } \ No newline at end of file