TAISAKU NISHIJIMA
/
penkich_percussion_1_LPC1114
for percussion1
Fork of penkich_test_percussion by
Revision 3:396b2628e3d7, committed 2015-08-30
- Comitter:
- penkich
- Date:
- Sun Aug 30 07:28:07 2015 +0000
- Parent:
- 2:269fadd5d1f2
- Commit message:
- penkich_percussion_1_LPC1114
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 269fadd5d1f2 -r 396b2628e3d7 main.cpp --- a/main.cpp Sun Aug 23 10:27:57 2015 +0000 +++ b/main.cpp Sun Aug 30 07:28:07 2015 +0000 @@ -1,11 +1,11 @@ #include "mbed.h" -DigitalIn sw(D7); +AnalogIn sw(dp9); Ticker timer; -PwmOut speaker(D5); +PwmOut speaker(dp1); Ticker envelope; -PwmOut env(D3); +PwmOut env(dp2); static int tms_per10=0; void env_out(void){ @@ -39,14 +39,15 @@ int main() { - sw.mode(PullUp); +// sw.mode(PullUp); while(1){ - if (sw ==0){ + if (sw >= 0.3f){ tms_per10=0; speaker.period_us(10); env.period_us(10); timer.attach_us(&sound_out,100); //10kHz envelope.attach_us(&env_out,100); //10kHz +// wait(1.0f); } wait(0.01f); }